/* Modern Layout Styles */

:root {
    --primary-blue: #001F54;
    --primary-orange: #FF7103;
    --accent-green: #008080;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --sidebar-width: 230px;
    --header-height: 60px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-gray);
    color: #4b5563;
    overflow-x: hidden;
    font-size: 0.9rem;
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.app-container.guest-layout {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fc 0%, #e2e8f0 100%);
}

/* ==================== MODERN SIDEBAR ==================== */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    border-right: 1px solid rgba(0, 31, 84, 0.08);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow:
        6px 0 30px rgba(0, 0, 0, 0.08),
        4px 0 20px rgba(0, 0, 0, 0.06),
        2px 0 10px rgba(0, 0, 0, 0.04),
        inset -1px 0 0 rgba(255, 255, 255, 0.5);
}

.sidebar-logo {
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 31, 84, 0.08);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-logo img {
    width: 80%;
    height: auto;
    max-width: 120px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s;
}

.sidebar-logo img:hover {
    transform: scale(1.05);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.5rem;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.875rem;
    color: #5a6c7d;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-orange));
    opacity: 0.1;
    transition: width 0.3s;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-blue);
    background: rgba(0, 31, 84, 0.04);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.1) 0%, rgba(255, 113, 3, 0.05) 100%);
    color: var(--primary-blue);
    font-weight: 600;
    box-shadow:
        0 2px 8px rgba(0, 31, 84, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-orange));
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    stroke-width: 2;
    transition: var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    transform: scale(1.1);
}

.nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.05);
}

.nav-link.disabled:hover {
    transform: none;
    background: rgba(148, 163, 184, 0.05);
    color: #94a3b8;
}

.nav-link.disabled::before {
    display: none;
}

.nav-link.disabled .nav-icon {
    opacity: 0.5;
    stroke-width: 2;
    transform: none;
}

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 31, 84, 0.1), transparent);
    margin: 1rem 0.5rem;
}

.nav-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-top: 0.5rem;
}

/* Sidebar Footer with User Card */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(0, 31, 84, 0.08);
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.04) 0%, rgba(255, 113, 3, 0.02) 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 31, 84, 0.06);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 3px 10px rgba(0, 31, 84, 0.25);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== MODERN HEADER ==================== */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content.full-width {
    margin-left: 0;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid rgba(0, 31, 84, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 12px rgba(0, 0, 0, 0.06),
        0 1px 6px rgba(0, 0, 0, 0.04),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

.header-left {
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 31, 84, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary-blue);
}

.mobile-menu-toggle:hover {
    background: rgba(0, 31, 84, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.04) 0%, rgba(255, 113, 3, 0.02) 100%);
    border: 1px solid rgba(0, 31, 84, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-trigger:hover {
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.08) 0%, rgba(255, 113, 3, 0.04) 100%);
    border-color: rgba(0, 31, 84, 0.15);
    box-shadow: 0 4px 12px rgba(0, 31, 84, 0.1);
    transform: translateY(-1px);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow:
        0 4px 12px rgba(0, 31, 84, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-blue);
    line-height: 1.2;
}

.profile-role {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

.profile-dropdown-icon {
    width: 18px;
    height: 18px;
    stroke: var(--primary-blue);
    transition: transform 0.3s;
}

.profile-dropdown.active .profile-dropdown-icon {
    transform: rotate(180deg);
}

/* Profile Menu Dropdown */
.profile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.profile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.04) 0%, rgba(255, 113, 3, 0.02) 100%);
    border-radius: 14px 14px 0 0;
}

.profile-menu-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(0, 31, 84, 0.3);
}

.profile-menu-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-blue);
    margin-bottom: 0.125rem;
}

.profile-menu-email {
    font-size: 0.8125rem;
    color: #6b7280;
}

.profile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 31, 84, 0.1), transparent);
    margin: 0.5rem 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.profile-menu-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: var(--transition);
}

.profile-menu-item:hover {
    background: rgba(0, 31, 84, 0.04);
    color: var(--primary-blue);
    padding-left: 1.5rem;
}

.profile-menu-item:hover svg {
    transform: scale(1.1);
}

.profile-menu-item.logout-item {
    color: #ef4444;
}

.profile-menu-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

/* ==================== MODAL STYLES ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.04) 0%, rgba(255, 113, 3, 0.02) 100%);
    border-bottom: 1px solid rgba(0, 31, 84, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    stroke: #6b7280;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
}

.modal-close:hover svg {
    stroke: #ef4444;
}

.modal-body {
    padding: 1.75rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid rgba(0, 31, 84, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 2px solid rgba(0, 31, 84, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 31, 84, 0.08);
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.modal-error,
.modal-success {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
    display: none;
}

.modal-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.modal-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.modal-error.show,
.modal-success.show {
    display: block;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), #003B8E);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 31, 84, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 31, 84, 0.35);
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.25rem;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.full-width .page-content {
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.content-wrapper {
    width: 100%;
    max-width: 100%;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .profile-info {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-header {
        padding: 0 1rem;
    }

    .page-content {
        padding: 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-orange));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00163a, #e55d00);
}