/**
 * WithYou Parent Web - Component Styles
 * Specialized components and modal overlays
 */

/* Modal Components */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-content {
    background: #FFFFFF;
    border: 2px solid #FFD555;
    border-radius: 24px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.33rem; /* 24px */
    color: #212121;
    line-height: 1.4;
}

.modal-body {
    margin-bottom: 32px;
}

.modal-body p {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 1rem; /* 18px */
    color: #212121;
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.privacy-note {
    color: #757575 !important;
    font-size: 0.94rem !important; /* 17px */
}

.instruction {
    font-weight: 500 !important;
    color: #212121 !important;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

/* Welcome Overlay */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 252, 241, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: welcomeSlideIn 0.4s ease-out;
}

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.welcome-content {
    text-align: center;
    padding: 48px 32px;
    background: #FFFFFF;
    border: 2px solid #FFD555;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 85%;
}

.welcome-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.56rem; /* 28px */
    color: #212121;
    line-height: 1.4;
}

/* Loading Components */
.loading-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-text {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 1.11rem; /* 20px */
    color: #212121;
    margin-bottom: 16px;
    line-height: 1.6;
}

.loading-subtext {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 0.89rem; /* 16px */
    color: #757575;
    line-height: 1.6;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin: 24px 0;
}

.loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #FFD555 0%, #FFCC50 46%, #FFB445 100%);
    animation: loadingPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Custom Button Components */
.button-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Accessibility Indicators */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Live Region for Screen Reader Announcements */
.live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Custom Form Components (if needed) */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-label {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 1rem; /* 18px */
    color: #212121;
    line-height: 1.4;
}

.form-input {
    font-family: 'Sora', sans-serif;
    font-size: 1rem; /* 18px */
    color: #212121;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 16px;
    min-height: 56px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: #FFD555;
    box-shadow: 0 0 0 3px rgba(255, 213, 85, 0.3);
}

.form-input::placeholder {
    color: #999999;
    opacity: 1;
}

/* Custom Audio Visualization */
.audio-visualizer {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 2px;
    height: 32px;
    min-width: 120px;
}

.visualizer-bar {
    width: 3px;
    background: #FFB445;
    border-radius: 2px;
    transition: height 0.1s ease;
    min-height: 2px;
}

/* Custom Progress Components */
.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    font-size: 0.89rem; /* 16px */
    color: #757575;
}

/* Touch-Friendly Components */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.large-touch-target {
    min-width: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    font-size: 0.94rem; /* 17px */
    line-height: 1.4;
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-icon.success {
    background-color: #4CAF50;
}

.status-icon.warning {
    background-color: #FF9800;
}

.status-icon.error {
    background-color: #F44336;
}

.status-icon.info {
    background-color: #2196F3;
}

.status-icon.recording {
    background-color: #FF4444;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

/* Card Variants */
.card {
    background: #FFFFFF;
    border: 2px solid #FFD555;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(33, 33, 33, 0.08);
    transition: all 0.2s ease;
}

.card.elevated {
    box-shadow: 0 8px 24px rgba(33, 33, 33, 0.12);
}

.card.interactive {
    cursor: pointer;
}

.card.interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(33, 33, 33, 0.15);
}

.card.interactive:active {
    transform: translateY(0);
}

/* Notification Components */
.notification {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: #FFFFFF;
    border: 2px solid #FFD555;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(33, 33, 33, 0.08);
    margin-bottom: 16px;
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-icon {
    flex-shrink: 0;
    font-size: 24px;
    line-height: 1;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 1rem; /* 18px */
    color: #212121;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-message {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 0.94rem; /* 17px */
    color: #757575;
    line-height: 1.5;
}

/* Skeleton Loading Components */
.skeleton {
    background: linear-gradient(90deg, #F0F0F0 25%, #E0E0E0 50%, #F0F0F0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1.2em;
    margin-bottom: 0.5em;
}

.skeleton-text.large {
    height: 1.8em;
}

.skeleton-text.small {
    height: 1em;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-button {
    height: 56px;
    border-radius: 28px;
}

/* Responsive Modal Adjustments */
@media (max-width: 480px) {
    .modal {
        padding: 16px;
    }
    
    .modal-content {
        padding: 24px;
        border-radius: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.22rem; /* 22px */
    }
    
    .modal-body p {
        font-size: 0.94rem; /* 17px */
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 20px;
    }
    
    .welcome-content {
        padding: 32px 24px;
    }
    
    .welcome-text {
        font-size: 1.33rem; /* 24px */
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .modal {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    /* Note: For now, maintaining light theme for parent web interface
       as designed for accessibility and older adult users */
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .modal-content,
    .welcome-content,
    .card {
        border-width: 3px;
        box-shadow: 0 0 0 2px #000000;
    }
    
    .skeleton {
        background: linear-gradient(90deg, #000000 25%, #333333 50%, #000000 75%);
    }
}