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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e0e0;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(15, 18, 35, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #667eea;
}

.icon-btn:active {
    transform: scale(0.95);
    background: rgba(102, 126, 234, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

/* Screen Management */
.screen {
    display: none;
    animation: slideIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Mood Section */
.mood-container {
    padding: 20px;
}

.screen-subtitle {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: #b0b0b0;
}

.mood-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e0e0e0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

.mood-btn:active {
    transform: scale(0.95);
}

.mood-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.6);
}

.mood-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: scale(1.05);
}

.mood-emoji {
    font-size: 40px;
    line-height: 1;
}

.mood-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Today's Mood Display */
.todays-mood {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.todays-mood.hidden {
    display: none;
}

.already-logged {
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
}

.current-mood-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mood-emoji-large {
    font-size: 64px;
    line-height: 1;
}

.mood-text-large {
    font-size: 24px;
    font-weight: 700;
}

/* Mood Stats */
.mood-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    font-size: 12px;
}

.stat-label {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Chart Section */
.chart-container {
    padding: 20px;
}

.chart-container h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.chart-subtitle {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.chart-wrapper {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    height: 240px;
}

#moodChart {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #b0b0b0;
}

.legend-item .emoji {
    font-size: 18px;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-title {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-content {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Summary Section */
.summary-container {
    padding: 20px;
}

.summary-container h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.summary-emoji {
    font-size: 32px;
    line-height: 1;
}

.summary-count {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-insights {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-text {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.6;
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.btn-secondary {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.4);
}

.btn-secondary:active {
    transform: scale(0.95);
    background: rgba(102, 126, 234, 0.3);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design */
@media (max-width: 480px) {
    .mood-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mood-btn {
        padding: 16px 12px;
        flex-direction: row;
        justify-content: center;
    }

    .mood-emoji {
        font-size: 32px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .chart-stats {
        grid-template-columns: 1fr;
    }

    .mood-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small phone optimization */
@media (max-height: 600px) {
    .header {
        padding: 12px 16px;
    }

    .header h1 {
        font-size: 20px;
    }

    .mood-container {
        padding: 12px;
    }

    .mood-selector {
        margin-bottom: 16px;
    }

    .mood-btn {
        padding: 12px;
    }

    .mood-emoji {
        font-size: 28px;
    }
}
