/* ===== Admin Panel Styles ===== */

.mhab-admin-wrap {
    background: #f5f5f5;
    padding: 20px;
    direction: rtl;
    font-family: 'Cairo', 'Tahoma', sans-serif;
}

.mhab-admin-wrap h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin: 0 0 30px 0;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.mhab-logo {
    font-size: 2em;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mhab-version {
    font-size: 0.5em;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    margin-right: auto;
}

/* ===== Activation Screen ===== */

.mhab-activation-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.mhab-activation-box {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.mhab-activation-box h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.mhab-activation-box p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

#mhab-activation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#mhab-activation-key {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#mhab-activation-key:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mhab-activation-note {
    margin-top: 30px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9em;
    text-align: right;
}

#mhab-activation-message {
    margin-top: 20px;
}

/* ===== Main Panel ===== */

.mhab-main-panel {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mhab-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.mhab-top-actions .button {
    padding: 10px 20px;
    height: auto;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mhab-top-actions .button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mhab-top-actions .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.mhab-top-actions .button-secondary {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.mhab-top-actions .button-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
}

#mhab-save-message {
    margin-bottom: 20px;
}

/* ===== Sections ===== */

.mhab-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.mhab-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #667eea;
}

.mhab-section h2 {
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
    font-size: 1.5em;
}

.form-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.form-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 15px 20px;
    width: 280px;
    vertical-align: top;
}

.form-table td {
    padding: 15px 20px;
}

.form-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.form-table tr:last-child {
    border-bottom: none;
}

.form-table input[type="number"],
.form-table input[type="text"],
.form-table select,
.form-table textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.form-table input[type="number"]:focus,
.form-table input[type="text"]:focus,
.form-table select:focus,
.form-table textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-table .description {
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
    line-height: 1.6;
}

/* ===== Toggle Switch ===== */

.mhab-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.mhab-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mhab-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.mhab-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.mhab-switch input:checked + .mhab-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mhab-switch input:checked + .mhab-slider:before {
    transform: translateX(30px);
}

/* ===== Modal ===== */

.mhab-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mhab-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mhab-modal-close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mhab-modal-close:hover,
.mhab-modal-close:focus {
    color: #000;
}

/* ===== Frontend Control Buttons ===== */

#mhab-control-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mhab-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mhab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.mhab-btn:active {
    transform: scale(0.95);
}

.mhab-btn-toggle {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.mhab-btn-toggle:not(.active) {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.mhab-btn-up {
    font-size: 16px;
}

.mhab-btn-down {
    font-size: 16px;
}

/* ===== Checkboxes ===== */

.form-table label input[type="checkbox"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== Notices ===== */

.notice {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 4px solid;
}

.notice-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.notice-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.notice-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.notice-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ===== Responsive Design ===== */

@media (max-width: 768px) {
    .mhab-admin-wrap {
        padding: 10px;
    }
    
    .mhab-admin-wrap h1 {
        font-size: 1.5em;
        padding: 15px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .mhab-version {
        margin-right: 0;
        margin-top: 10px;
    }
    
    .mhab-top-actions {
        flex-direction: column;
    }
    
    .mhab-top-actions .button {
        width: 100%;
    }
    
    .mhab-section {
        padding: 15px;
    }
    
    .form-table th {
        width: auto;
        display: block;
        padding: 10px;
    }
    
    .form-table td {
        display: block;
        padding: 10px;
    }
    
    .form-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
    }
    
    .mhab-activation-box {
        padding: 30px 20px;
    }
    
    .mhab-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    #mhab-control-buttons {
        bottom: 10px;
        left: 10px;
    }
    
    .mhab-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ===== Loading Animation ===== */

.mhab-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Tables ===== */

.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.wp-list-table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: right;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.wp-list-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.wp-list-table tbody tr:hover {
    background: #f8f9fa;
}

/* ===== Tooltips ===== */

[title] {
    position: relative;
    cursor: help;
}

/* ===== Custom Scrollbar ===== */

.mhab-modal-content::-webkit-scrollbar {
    width: 10px;
}

.mhab-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mhab-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.mhab-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ===== Smooth Transitions ===== */

* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

input, select, textarea, button {
    transition: all 0.3s ease;
}

/* ===== Print Styles ===== */

@media print {
    #mhab-control-buttons,
    .mhab-top-actions,
    .mhab-modal {
        display: none !important;
    }
}

/* ===== Accessibility ===== */

.mhab-btn:focus,
.mhab-switch input:focus + .mhab-slider,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===== High Contrast Mode ===== */

@media (prefers-contrast: high) {
    .mhab-admin-wrap h1,
    .mhab-btn {
        background: #000;
        color: #fff;
    }
    
    .form-table input,
    .form-table select,
    .form-table textarea {
        border: 2px solid #000;
    }
}

/* ===== Dark Mode Support ===== */

@media (prefers-color-scheme: dark) {
    .mhab-admin-wrap {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .mhab-section {
        background: #2a2a2a;
        border-color: #404040;
    }
    
    .form-table {
        background: #2a2a2a;
    }
    
    .form-table th {
        background: #333;
        color: #e0e0e0;
    }
    
    .form-table td {
        color: #e0e0e0;
    }
    
    .form-table input,
    .form-table select,
    .form-table textarea {
        background: #333;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .mhab-modal-content {
        background: #2a2a2a;
        color: #e0e0e0;
    }
}

/* ===== Animation for Success Messages ===== */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notice.is-dismissible {
    animation: slideInRight 0.5s ease;
}

/* ===== Badge Styles ===== */

.mhab-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-right: 8px;
}

.mhab-badge.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.mhab-badge.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.mhab-badge.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* ===== Card Layout ===== */

.mhab-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.mhab-card-header {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.mhab-card-body {
    line-height: 1.6;
}

/* ===== Grid Layout ===== */

.mhab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mhab-grid-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mhab-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}