/**
 * Day Dream App - Voice Idea Capture
 * Dreamy, meditative, creative. Like catching thoughts as they drift by.
 * @version 1.0.0
 */

/* =============================================================================
   THEME VARIABLES
   ============================================================================= */

.app-day-dream {
    --dream-accent: #7C3AED;
    --dream-accent-hover: #6D28D9;
    --dream-accent-light: #A78BFA;
    --dream-accent-pale: #C4B5FD;
    --dream-star: #FCD34D;
    --dream-border: rgb(124 58 237 / 12%);
    --dream-tint: rgb(124 58 237 / 5%);
    --dream-record: #EF4444;
    --dream-record-hover: #DC2626;
    --dream-record-glow: rgb(239 68 68 / 25%);
}

/* =============================================================================
   BASE LAYOUT
   ============================================================================= */

.day-dream-main {
    min-height: 100vh;
    background-color: #F5F3FF;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 40px;
}

.day-dream-container {
    background: linear-gradient(180deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgb(124 58 237 / 8%);
    border: 1px solid var(--dream-border);
    padding: 36px 28px 32px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* =============================================================================
   GREETING HEADER
   ============================================================================= */

.day-dream-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.day-dream-icon {
    font-size: 48px;
    line-height: 1;
}

.day-dream-greeting-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dream-accent);
    letter-spacing: -0.3px;
}

.day-dream-greeting-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--dream-accent-light);
    margin-top: 2px;
}

/* =============================================================================
   MODEL STATUS
   ============================================================================= */

.model-status {
    width: 100%;
    text-align: center;
}

.model-progress {
    width: 100%;
    height: 6px;
    background: var(--dream-tint);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--dream-border);
}

.model-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--dream-accent-light), var(--dream-accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.model-progress-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--dream-accent-light);
    margin-top: 8px;
}

/* =============================================================================
   VISUALIZER
   ============================================================================= */

.day-dream-visualizer {
    width: 100%;
    height: 64px;
    border-radius: 12px;
    background: rgb(124 58 237 / 4%);
    border: 1px solid var(--dream-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-dream-visualizer canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.day-dream-visualizer.recording {
    border-color: var(--dream-record);
    background: rgb(239 68 68 / 4%);
}

/* =============================================================================
   STATUS
   ============================================================================= */

.day-dream-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--dream-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-dream-status.recording {
    color: var(--dream-record);
}

.day-dream-status.transcribing {
    color: var(--dream-accent);
}

.status-duration {
    font-variant-numeric: tabular-nums;
}

/* Recording pulse dot */
.status-dot {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dream-record);
    animation: pulse-dot 1.2s ease-in-out infinite;
}

.day-dream-status.recording .status-dot {
    display: block;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* =============================================================================
   RECORDING CONTROLS
   ============================================================================= */

.day-dream-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Hold button - large circular mic button */
.hold-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--dream-accent);
    background: linear-gradient(135deg, var(--dream-accent) 0%, var(--dream-accent-hover) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    box-shadow: 0 4px 20px rgb(124 58 237 / 30%);
}

.hold-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgb(124 58 237 / 40%);
}

.hold-button:active:not(:disabled) {
    transform: scale(0.98);
}

.hold-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hold-button.recording {
    background: linear-gradient(135deg, var(--dream-record) 0%, var(--dream-record-hover) 100%);
    border-color: var(--dream-record);
    box-shadow: 0 4px 20px var(--dream-record-glow);
    animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 4px 20px var(--dream-record-glow), 0 0 0 0 rgb(239 68 68 / 30%);
    }
    50% {
        box-shadow: 0 4px 20px var(--dream-record-glow), 0 0 0 12px rgb(239 68 68 / 0%);
    }
}

.hold-button-icon {
    font-size: 32px;
    line-height: 1;
}

.hold-button-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Toggle controls */
.toggle-controls {
    display: flex;
    gap: 12px;
}

.toggle-button {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dream-accent);
    background: var(--dream-tint);
    border: 1.5px solid rgb(124 58 237 / 15%);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.toggle-button:hover:not(:disabled) {
    background: rgb(124 58 237 / 10%);
    border-color: var(--dream-accent);
}

.toggle-button.recording {
    color: white;
    background: var(--dream-record);
    border-color: var(--dream-record);
}

.toggle-button.recording:hover:not(:disabled) {
    background: var(--dream-record-hover);
}

.toggle-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================================
   TODAY'S COUNT
   ============================================================================= */

.today-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--dream-accent);
    padding: 8px 20px;
    background: var(--dream-tint);
    border-radius: 20px;
    border: 1px solid rgb(124 58 237 / 10%);
}

/* =============================================================================
   IDEAS SECTION
   ============================================================================= */

.ideas-section {
    width: 100%;
}

.ideas-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dream-accent);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
}

.ideas-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ideas-toggle[aria-expanded="false"] .ideas-toggle-icon {
    transform: rotate(-90deg);
}

.ideas-list {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.ideas-list.expanded {
    display: flex;
}

.ideas-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--dream-accent-light);
    font-size: 14px;
    font-style: italic;
}

/* =============================================================================
   IDEA CARD
   ============================================================================= */

.idea-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid var(--dream-border);
    transition: box-shadow 0.2s ease;
}

.idea-card:hover {
    box-shadow: 0 2px 8px rgb(124 58 237 / 8%);
}

.idea-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.idea-card-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--dream-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.idea-card-duration {
    font-size: 11px;
    color: var(--dream-accent-pale);
    font-variant-numeric: tabular-nums;
}

.idea-card-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-primary, #333);
    word-wrap: break-word;
}

.idea-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: flex-end;
}

.idea-card-action {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--dream-border);
    background: var(--dream-tint);
    color: var(--dream-accent-light);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.idea-card-action:hover {
    background: rgb(124 58 237 / 10%);
    color: var(--dream-accent);
    border-color: var(--dream-accent);
}

.idea-card-action--delete:hover {
    background: rgb(239 68 68 / 8%);
    color: #EF4444;
    border-color: #EF4444;
}

/* =============================================================================
   COMPATIBILITY NOTICE
   ============================================================================= */

.day-dream-notice {
    width: 100%;
    padding: 16px;
    background: rgb(245 158 11 / 8%);
    border: 1px solid rgb(245 158 11 / 20%);
    border-radius: 12px;
    text-align: center;
}

.day-dream-notice-text {
    font-size: 14px;
    color: #92400E;
    line-height: 1.5;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 480px) {
    .day-dream-main {
        padding: 76px 16px 32px;
    }

    .day-dream-container {
        padding: 28px 20px 24px;
        gap: 18px;
        border-radius: 16px;
    }

    .day-dream-icon {
        font-size: 40px;
    }

    .hold-button {
        width: 100px;
        height: 100px;
    }

    .hold-button-icon {
        font-size: 28px;
    }

    .hold-button-text {
        font-size: 10px;
    }

    .idea-card {
        padding: 12px 14px;
    }
}

@media (min-width: 768px) {
    .day-dream-container {
        max-width: 500px;
        padding: 32px;
        border-radius: 24px;
    }
}

@media (min-width: 1024px) {
    .day-dream-container {
        max-width: 560px;
        padding: 40px;
    }
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    .hold-button,
    .toggle-button,
    .idea-card,
    .idea-card-action,
    .model-progress-bar,
    .status-dot {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
