/* ============================================
   CUSTOM STYLES & OVERRIDES
   ============================================ */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Page Transitions */
.main-content {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.main-content.fade-out {
    opacity: 0;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #6366f1;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #94a3b8;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* Error Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #6366f1;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #f8fafc;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast--error {
    border-left-color: #ef4444;
}

.toast--success {
    border-left-color: #22c55e;
}

/* Password Modal Styles (Extracted from index.html) */
.password-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.65);
    backdrop-filter: blur(4px);
    padding: 1.5rem;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.password-modal--open {
    opacity: 1;
    pointer-events: auto;
}

.password-modal__card {
    width: min(100%, 380px);
    background: #0f172a;
    color: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.password-modal--open .password-modal__card {
    transform: scale(1);
}

.password-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.password-modal__desc {
    font-size: 0.95rem;
    color: rgba(248, 250, 252, 0.75);
    margin-bottom: 1.5rem;
}

.password-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.password-modal__input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(248, 250, 252, 0.25);
    background: rgba(15, 23, 42, 0.6);
    color: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.password-modal__input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.password-modal__input.error {
    border-color: #ef4444;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.password-modal__error {
    color: #f87171;
    font-size: 0.9rem;
    min-height: 1.1rem;
    margin-top: 0.25rem;
}

.password-modal__actions {
    display: flex;
    gap: 0.75rem;
}

.password-modal__actions button {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s;
}

.password-modal__actions button:active {
    transform: scale(0.98);
}

.password-modal__actions button[type="submit"] {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.password-modal__actions button[type="button"] {
    background: rgba(248, 250, 252, 0.1);
    color: rgba(248, 250, 252, 0.85);
}

.password-modal__actions button[type="button"]:hover {
    background: rgba(248, 250, 252, 0.15);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .password-modal__card {
        padding: 1.5rem;
        width: 100%;
        margin: 1rem;
    }

    /* Ensure touch targets are large enough */
    button, 
    a, 
    input {
        min-height: 44px;
    }
    
    .sidebar__link {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}
