/* ============================================
   ADMIN DASHBOARD STYLES - MODERN REDESIGN
   ============================================ */

/* --- VARIABLES & RESET --- */
:root {
    --admin-bg: #f8fafc;         /* Slate 50 */
    --admin-sidebar-bg: #ffffff; /* White */
    --admin-content-bg: #ffffff; /* White */
    --admin-border: #e2e8f0;     /* Slate 200 */
    --admin-text-main: #0f172a;  /* Slate 900 */
    --admin-text-muted: #64748b; /* Slate 500 */
    --admin-primary: #01b5cc;
    --admin-primary-light: #f0fdfa; /* Teal 50 */
    --admin-danger: #ef4444;
    --admin-danger-light: #fef2f2;
    --admin-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --admin-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --admin-radius: 12px;
}

body.is-admin {
    background-color: var(--admin-bg);
    color: var(--admin-text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- LAYOUT --- */
.admin-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- SIDEBAR --- */
.admin-sidebar {
    background: var(--admin-sidebar-bg);
    border-radius: var(--admin-radius);
    padding: 1rem;
    position: sticky;
    top: 1.5rem;
    height: calc(100vh - 3rem);
    box-shadow: var(--admin-shadow-md);
    display: flex;
    flex-direction: column;
}

.admin-sidebar .logo {
    padding: 1rem 1rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--admin-text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-sidebar .logo i {
    color: var(--admin-primary);
    font-size: 1.8rem;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.admin-sidebar li {
    margin-bottom: 0.5rem;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--admin-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-sidebar a:hover {
    background-color: var(--admin-primary-light);
    color: var(--admin-primary);
}

.admin-sidebar a.active {
    background-color: var(--admin-primary);
    color: white;
    box-shadow: 0 4px 10px -2px rgba(1, 181, 204, 0.4);
}

.admin-sidebar a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.admin-sidebar .logout-link {
    margin-top: auto;
}

/* --- CONTENT AREA --- */
.admin-content {
    background: var(--admin-content-bg);
    border-radius: var(--admin-radius);
    padding: 2rem;
    box-shadow: var(--admin-shadow-md);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--admin-text-main);
    letter-spacing: -0.03em;
}

.admin-header p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: 1rem;
}

.admin-header .btn {
    margin: 0;
}

/* --- LOGIN PAGE --- */
.admin-login-container {
    max-width: 450px;
    margin: 6rem auto;
    padding: 2rem;
}

.admin-login-form {
    background: var(--admin-content-bg);
    padding: 3rem;
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow-md);
    text-align: center;
}

.admin-login-form h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--admin-text-main);
    margin-bottom: 0.5rem;
}

.admin-login-form p {
    color: var(--admin-text-muted);
    margin-bottom: 2.5rem;
}

.admin-login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.admin-login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-login-form .form-control {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.admin-login-form .form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(1, 181, 204, 0.2);
}

.admin-login-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* --- GENERAL COMPONENTS --- */

/* Cards */
.card {
    background-color: var(--admin-content-bg);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow-md);
    border: 1px solid var(--admin-border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}
.card-header h2 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f8fafc;
}

.admin-table td {
    color: var(--admin-text-main);
    font-size: 0.95rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background-color: #f8fafc;
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--admin-text-main);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(1, 181, 204, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}
.btn-primary:hover {
    background: #0093a7;
    border-color: #0093a7;
}

.btn-secondary {
    background: var(--admin-sidebar-bg);
    color: var(--admin-text-main);
    border-color: var(--admin-border);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
    border-color: var(--admin-danger);
}
.btn-danger:hover {
    background: #d9534f;
    border-color: #d43f3a;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
}
.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* --- DASHBOARD SPECIFIC --- */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--admin-border);
    transition: all 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--admin-shadow-md);
}
.stat-card i {
    font-size: 2rem;
    color: var(--admin-primary);
    margin-bottom: 1rem;
}
.stat-card h3 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--admin-text-main);
}
.stat-card p {
    margin: 0;
    color: var(--admin-text-muted);
    font-weight: 600;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.95rem;
}
.activity-list li:last-child {
    border-bottom: none;
}
.activity-list span {
    float: right;
    color: var(--admin-text-muted);
    font-size: 0.9rem;
}

/* --- MENU MANAGER SPECIFIC --- */
.menu-manager-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.menu-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-tree-container {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 2rem;
    min-height: 400px;
}

.menu-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Nested menu children styling */
.menu-children {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    padding-left: 32px;
    border-left: 3px solid #e2e8f0;
    position: relative;
}

.menu-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    transition: all 0.2s ease;
    position: relative;
}

.menu-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Level colors with distinct visual hierarchy */
.menu-item.level-1 { 
    border-left: 4px solid #3b82f6; 
    background: #fff;
}

.menu-item.level-2 { 
    border-left: 4px solid #a855f7; 
    background: #fff;
}

.menu-item.level-3 { 
    border-left: 4px solid #22c55e; 
    background: #fff;
}

.drag-handle {
    color: #cbd5e1;
    margin-right: 15px;
    cursor: grab;
    transition: color 0.2s;
}
.menu-item:hover .drag-handle { color: var(--admin-text-muted); }
.menu-item.dragging { opacity: 0.5; background: var(--admin-primary-light); }

.menu-info { flex-grow: 1; }
.menu-title { font-weight: 600; font-size: 1rem; color: var(--admin-text-main); margin: 0; }
.menu-level { font-size: 0.8rem; color: var(--admin-text-muted); margin-top: 2px; }

.menu-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}
.menu-item:hover .menu-actions { opacity: 1; }

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
    background: #fff;
    color: var(--admin-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-icon:hover { background: #f8fafc; color: var(--admin-primary); border-color: var(--admin-primary); }
.btn-delete:hover { background: var(--admin-danger-light); color: var(--admin-danger); border-color: var(--admin-danger); }

.sortable-placeholder {
    background: rgba(1, 181, 204, 0.1);
    border: 2px dashed var(--admin-primary);
    border-radius: 8px;
    margin-bottom: 10px;
    height: 50px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 2rem;
    border-radius: var(--admin-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    animation: modal-fade-in 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-button {
    color: var(--admin-text-muted);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}
.close-button:hover { color: var(--admin-text-main); }

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.modal-footer {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* --- MODERN MODAL REDESIGN --- */
.modal-modern {
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
}

.modal-header-premium {
    background: linear-gradient(135deg, #01b5cc 0%, #0e7490 100%);
    padding: 2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: none;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon-badge {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.modal-header-premium h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-subtitle {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.modal-header-premium .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.modal-header-premium .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body-modern {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row-two-cols {
    grid-template-columns: 1fr 1fr;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--admin-text-main);
    margin-bottom: 0.6rem;
}

.form-group label i {
    color: var(--admin-primary);
    font-size: 1rem;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

.optional {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-control-modern {
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    color: var(--admin-text-main);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--admin-primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(1, 181, 204, 0.1);
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

.form-helper {
    display: block;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-top: 0.4rem;
    font-weight: 500;
}

.page-dropdown-modern {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--admin-primary);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1060;
    margin-top: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(1, 181, 204, 0.2);
}

.page-dropdown-modern .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--admin-text-main);
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-dropdown-modern .dropdown-item:hover {
    background-color: #f0fdfa;
    color: var(--admin-primary);
    padding-left: 1.3rem;
}

.modal-footer-modern {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-ghost {
    background: white;
    color: var(--admin-text-main);
    border: 2px solid var(--admin-border);
    padding: 0.7rem 1.5rem;
}

.btn-ghost:hover {
    background: var(--admin-primary-light);
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.btn-primary-modern {
    background: linear-gradient(135deg, #01b5cc 0%, #0e7490 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    box-shadow: 0 4px 15px -2px rgba(1, 181, 204, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -2px rgba(1, 181, 204, 0.4);
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
