/* ================================================
   Moon Phase Today - Dark Theme CSS
   Mobile-First Responsive Design
   ================================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-card: #1a2235;
    --bg-card-hover: #202842;
    
    /* Accent Colors */
    --accent-primary: #ffd700;
    --accent-secondary: #4a90e2;
    --accent-glow: rgba(255, 215, 0, 0.3);
    
    /* Text Colors */
    --text-primary: #e8eaf0;
    --text-secondary: #a8b2c8;
    --text-muted: #6b7589;
    
    /* Moon Phase Colors */
    --moon-new: #2a2a3e;
    --moon-waxing: #4a5f8f;
    --moon-full: #ffd700;
    --moon-waning: #8f7a4a;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm);
    min-height: 100vh;
}

/* Header */
.app-header {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-sm);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.header-logo {
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: float 3s ease-in-out infinite;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: var(--shadow-glow);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Content */
.app-main {
    flex: 1;
    position: relative;
    overflow: visible;
    margin-bottom: var(--spacing-md);
}

/* Day View Container */
.day-view {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

.day-view.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.day-view.slide-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

.day-view.slide-right {
    animation: slideInRight 0.4s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Moon Card */
.moon-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.moon-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.moon-date {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

.moon-display {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.moon-icon {
    font-size: 6rem;
    line-height: 1;
    margin: var(--spacing-md) 0;
    filter: drop-shadow(var(--shadow-glow));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.moon-age {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
}

.moon-age-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
    margin: var(--spacing-xs) 0;
}

/* Moon Info Grid */
.moon-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.info-item {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    transition: background 0.3s ease;
}

.info-item:hover {
    background: var(--bg-card-hover);
}

.info-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

/* Week Preview Cards */
.week-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.preview-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.preview-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.preview-card.active {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.preview-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.preview-moon {
    font-size: 2.5rem;
    margin: var(--spacing-xs) 0;
}

.preview-age {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Navigation Buttons */
.week-preview {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.nav-btn {
    flex: 1;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--accent-secondary), #357abd);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn span {
    font-size: 1.2rem;
    margin: 0 var(--spacing-xs);
}

/* Swipe Hint */
.swipe-hint {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hint-arrow {
    font-size: 1.2rem;
    color: var(--accent-primary);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    min-height: 300px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--bg-card);
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-logo {
        width: 60px;
        height: 60px;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .moon-icon {
        font-size: 6rem;
    }

    .moon-info {
        grid-template-columns: 1fr;
    }

    .week-preview-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: var(--spacing-xs);
    }

    .app-header {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .site-logo {
        width: 50px;
        height: 50px;
    }

    .moon-card {
        padding: var(--spacing-md);
    }

    .nav-btn {
        font-size: 0.9rem;
        padding: var(--spacing-sm);
    }
}

/* Touch Feedback */
@media (hover: none) {
    .moon-card:active,
    .preview-card:active,
    .nav-btn:active {
        opacity: 0.8;
    }
}

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

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .nav-btn,
    .swipe-hint,
    .app-footer {
        display: none;
    }
}
