/* ============================================================================
   Daily Challenge Arena - UI Components
   Toast notifications, loaders, modals, and form validation styles
   ============================================================================ */

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.dca-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(500px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dca-toast.dca-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.dca-toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.dca-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.dca-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
}

.dca-toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.dca-toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

/* Toast Type Colors */
.dca-toast-success {
    border-left: 4px solid #10b981;
}

.dca-toast-error {
    border-left: 4px solid #ef4444;
}

.dca-toast-warning {
    border-left: 4px solid #f59e0b;
}

.dca-toast-info {
    border-left: 4px solid #3b82f6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dca-toast {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none;
    }
}

/* ============================================================================
   LOADING SPINNERS
   ============================================================================ */

.dca-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: dca-spin 0.8s linear infinite;
}

.dca-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: dca-spin 1s linear infinite;
}

@keyframes dca-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.dca-loading {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed !important;
}

.dca-loading .dca-spinner {
    margin-right: 8px;
}

/* ============================================================================
   PAGE LOADER
   ============================================================================ */

.dca-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dca-page-loader.dca-page-loader-show {
    opacity: 1;
    pointer-events: all;
}

.dca-page-loader-content {
    text-align: center;
}

.dca-page-loader-content p {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
}

/* ============================================================================
   MODAL / DIALOG
   ============================================================================ */

.dca-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dca-modal.dca-modal-show {
    opacity: 1;
    pointer-events: all;
}

.dca-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.dca-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dca-modal.dca-modal-show .dca-modal-content {
    transform: scale(1);
}

.dca-modal-body {
    padding: 32px;
}

.dca-modal-body p {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.dca-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dca-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.dca-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.dca-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.dca-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.dca-btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================================================
   FORM VALIDATION STYLES
   ============================================================================ */

.field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    animation: dca-shake 0.3s;
}

@keyframes dca-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.field-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.field-invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-valid {
    border-color: #10b981 !important;
}

.field-valid:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* ============================================================================
   PASSWORD STRENGTH METER
   ============================================================================ */

.password-strength-meter {
    margin-top: 12px;
}

.password-strength-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 999px;
}

.password-strength-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: block;
}

.password-requirements {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirement-icon {
    font-weight: bold;
    font-size: 14px;
    color: #9ca3af;
}

.requirement.met {
    color: #059669;
}

.requirement.met .requirement-icon {
    color: #10b981;
}

/* ============================================================================
   CONFETTI ANIMATION
   ============================================================================ */

.dca-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: dca-confetti-fall linear forwards;
    pointer-events: none;
}

@keyframes dca-confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================================================
   SKELETON LOADERS
   ============================================================================ */

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: dca-skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes dca-skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-card {
    height: 200px;
    width: 100%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ============================================================================
   BADGE STYLES
   ============================================================================ */

.dca-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.dca-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.dca-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.dca-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.dca-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.fade-in {
    animation: dca-fade-in 0.3s;
}

@keyframes dca-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: dca-slide-up 0.3s;
}

@keyframes dca-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: dca-pulse 2s infinite;
}

@keyframes dca-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================================================
   MOBILE MENU STYLES
   ============================================================================ */

#mobileMenu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileMenu.mobile-menu-open {
    max-height: 600px;
    opacity: 1;
}

#mobileMenu a {
    padding: 12px 0;
    transition: all 0.2s;
}

#mobileMenu a:hover {
    padding-left: 8px;
}

/Mobile Menu Backdrop */ .mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-menu-backdrop.show {
    opacity: 1;
    pointer-events: all;
}