/* ========== Base Styles ========== */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: hidden;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: #333;
    background-color: #f5f6fa;
    margin-bottom: 60px;
}

/* ========== Utility Classes ========== */
.fa-solid {
    margin-right: 0.5rem;
}

/* ========== Button & Form Focus ========== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ========== Layout ========== */
.layout {
    display: flex;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 30px;
    background: #f5f6fa;
    position: relative;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.section-container {
    width: 100%;
    min-height: 0;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 350px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    transition: transform 0.3s ease;
    z-index: 1001;
}

    .sidebar .close-icon {
        display: none;
        font-size: 1.6rem;
        cursor: pointer;
        align-self: flex-end;
        padding: 10px 15px;
        color: #333;
    }

/* ========== Navigation ========== */
.nav-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 22px;
    color: #333;
    border-left: 4px solid transparent;
    transition: all 0.25s ease;
}

    .nav-item:hover {
        background: #f0f4fa;
    }

    .nav-item.active {
        background: #e6f2fc;
        border-left-color: #0078d4;
        color: #0078d4;
        font-weight: 600;
    }

/* ========== Overlay (Sidebar & Spinner) ========== */
.overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100% - 56px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .overlay.show {
        display: block;
        opacity: 1;
    }

/* ========== Spinner Overlay ========== */
.spinner-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.25);
    z-index: 200;
    align-items: center;
    justify-content: center;
    display: flex;
}

.spinner-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.spinner {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto 1rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 2s cubic-bezier(0.5,0,0.5,1) infinite;
}

.ring-1 {
    border-top-color: #fbac41;
    animation-delay: 0s;
}

.ring-2 {
    border-right-color: #8ac44a;
    animation-delay: 0.15s;
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
}

.ring-3 {
    border-bottom-color: #0b4888;
    animation-delay: 0.3s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.ring-4 {
    border-left-color: #008099;
    animation-delay: 0.45s;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: rotate(180deg);
        opacity: 0.7;
    }

    100% {
        transform: rotate(360deg);
        opacity: 1;
    }
}

.spinner-text {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========== Header Bar & Hamburger ========== */
.header-bar {
    width: 100%;
    background-color: #224c85;
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 1rem;
    justify-content: space-between;
}

.hamburger {
    color: #fff;
    font-size: 2rem;
    margin-right: 1rem;
}

/* ========== Error Partial ========== */
.error-container {
    background: #0b4888;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    width: 100%;
    padding: 64px 56px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.illustration-container {
    width: 100%;
    height: 400px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafbfc;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.content-section {
    text-align: center;
}

.error-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.error-message {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ========== Animations ========== */
@keyframes float {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes blink {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes errorBlink {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

@keyframes headShake {
    0%,100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.blink-animation {
    animation: blink 1.5s ease-in-out infinite;
}

.error-blink {
    animation: errorBlink 1.2s ease-in-out infinite;
}

.shake-animation {
    animation: headShake 0.5s ease-in-out infinite;
}

.centered-section-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .error-container {
        max-width: 98vw;
        padding: 40px 20px;
    }

    .illustration-container {
        height: 300px;
    }

    .error-title {
        font-size: 2rem;
    }

    .error-message {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .sidebar .close-icon {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100% - 56px);
        transform: translateX(-100%);
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
        background: #fff;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .content {
        padding: 20px;
    }

    .layout {
        flex-direction: column;
    }

    .header-bar {
        position: relative !important;
        height: 56px !important;
        padding: 0 !important;
    }

    .hamburger {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        height: 56px !important;
        width: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 1100 !important;
        font-size: 2rem !important;
        background: transparent !important;
        border: none !important;
    }

    .header-bar .container {
        padding-left: 56px !important;
        height: 56px !important;
        align-items: center !important;
    }

    .error-container {
        padding: 30px 10px;
    }

    .illustration-container {
        height: 220px;
    }

        .illustration-container svg {
            transform: scale(0.85);
        }

    .error-title {
        font-size: 1.5rem;
    }

    .error-message {
        font-size: 1rem;
    }
}

@media (max-width: 520px) {
    .spinner-container {
        padding: 1rem;
        border-radius: 10px;
        min-width: 0;
        max-width: 90vw;
    }

    .spinner {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
    }

    .spinner-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .illustration-container {
        height: 140px;
    }

        .illustration-container svg {
            transform: scale(0.7);
        }

    .error-title {
        font-size: 1.15rem;
    }

    .error-message {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }
}