/* =====================================================
   MODAL AND DIALOG COMPONENTS
   WCAG 2.1 AA Compliant
   ===================================================== */

/* =====================================================
   USER PROFILE DROPDOWN
   Dropdown menu for authenticated user actions
   ===================================================== */

.profile-dropdown-container {
    position: relative;
}

.profile-dropdown-trigger {
    cursor: pointer;
}

.profile-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: var(--font-size-sm);
    font-family: inherit;
    min-height: 44px;
}

.profile-dropdown-item:hover,
.profile-dropdown-item:focus {
    background: rgba(106, 74, 158, 0.1);
    text-decoration: none;
    color: var(--primary-color);
}

.profile-dropdown-item:hover i,
.profile-dropdown-item:focus i {
    color: var(--primary-color);
}

.profile-dropdown-item:focus-visible {
    outline: 2px solid var(--focus-color, var(--primary-color));
    outline-offset: -2px;
}

.profile-dropdown-item i {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

/* =====================================================
   CONFIRMATION MODAL
   Reusable modal for confirmation dialogs
   WCAG: Focus trap, high contrast, keyboard accessible
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirmation-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-white);
    border-radius: 1.5rem;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    max-width: 460px;
    width: calc(100% - 2rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.confirmation-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    padding: 3rem 2.5rem;
    text-align: center;
}

.modal-logo {
    margin-bottom: 2rem;
}

.modal-logo img {
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
}

.modal-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.modal-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.7;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.modal-btn {
    padding: 0.875rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 48px;
    min-width: 120px;
    border: none;
    font-family: inherit;
}

.modal-btn-cancel {
    background: var(--bg-gray-light);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.modal-btn-cancel:hover {
    background: var(--glass-white);
}

.modal-btn-confirm {
    background: var(--primary-color);
    color: var(--primary-color-text);
}

.modal-btn-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.modal-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .confirmation-modal,
    .modal-overlay {
        transition: none;
    }
}


/* =====================================================
   SIDEBAR ERROR (ErrorBoundary fallback)
   Graceful error display when sidebar components fail
   ===================================================== */

.sidebar-error {
    background: var(--bg-white);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    box-shadow: 0px 4px 20px 0px rgba(209, 209, 209, 0.15);
}

.sidebar-error i {
    font-size: 2rem;
    color: var(--bs-warning, #ffc107);
    display: block;
    margin-bottom: 0.75rem;
}

.sidebar-error p {
    margin: 0 0 1rem 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.sidebar-error .btn {
    min-height: 36px;
}

/* ===========================================
   NOTIFICATION MODAL
   Single-button notification dialogs for
   success, info, warning, and error messages
   =========================================== */

.notification-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.notification-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.notification-modal .modal-content {
    background: var(--bg-white);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.notification-modal .modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.notification-modal .modal-icon.success {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.notification-modal .modal-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-modal .modal-icon.warning {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.notification-modal .modal-icon.error {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.notification-modal .modal-btn-confirm.success {
    background: #059669;
}

.notification-modal .modal-btn-confirm.success:hover {
    background: #047857;
}

.notification-modal .modal-btn-confirm.info {
    background: #3b82f6;
}

.notification-modal .modal-btn-confirm.info:hover {
    background: #2563eb;
}

.notification-modal .modal-btn-confirm.warning {
    background: #d97706;
}

.notification-modal .modal-btn-confirm.warning:hover {
    background: #b45309;
}

.notification-modal .modal-btn-confirm.error {
    background: #dc2626;
}

.notification-modal .modal-btn-confirm.error:hover {
    background: #b91c1c;
}
