* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.play-regular {
    font-family: "Play", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.play-bold {
    font-family: "Play", sans-serif;
    font-weight: 700;
    font-style: normal;
}

body {
    font-family: "Play", sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1b4b 50%, #2d1b4e 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: 80px;
}


.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 40px;
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.95), rgba(75, 74, 77, 0.85));
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 217, 95, 0.3);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 217, 95, 0.1), transparent);
    animation: headerShine 3s ease-in-out infinite;
    pointer-events: none;
}

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

h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: lowercase;
    letter-spacing: 3px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.tagline {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

nav {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.nav-btn {
    padding: 10px 25px;
    border: none;
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.15), rgba(255, 217, 95, 0.05));
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 217, 95, 0.2);
    text-transform: lowercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 217, 95, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-btn:hover::before {
    width: 300px;
    height: 300px;
}

.nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.25), rgba(255, 217, 95, 0.15));
    border-color: #FFD95F;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 217, 95, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    border-color: #FFD95F;
    color: #1a1b4b;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(255, 217, 95, 0.5);
}

.nav-btn span {
    position: relative;
    z-index: 1;
}

.card {
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.3), rgba(75, 74, 77, 0.15));
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 35px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 217, 95, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 217, 95, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.card h2 {
    color: #FFD95F;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-transform: lowercase;
    letter-spacing: 1px;
}

.card h3 {
    text-transform: lowercase;
    letter-spacing: 0.5px;
    color: #FFD95F;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #FFD95F;
    text-transform: lowercase;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

input[type="date"],
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 217, 95, 0.2);
    background: rgba(75, 74, 77, 0.4);
    color: #fff;
    font-size: 1em;
    font-family: "Play", sans-serif;
    transition: all 0.3s ease;
}

input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #FFD95F;
    background: rgba(75, 74, 77, 0.6);
    box-shadow: 0 0 20px rgba(255, 217, 95, 0.2);
}

input[type="date"]::placeholder,
input[type="number"]::placeholder,
input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

input[type="range"] {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(255, 217, 95, 0.2), rgba(255, 217, 95, 0.5));
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 217, 95, 0.5);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(255, 217, 95, 0.8);
}

input[type="range"]::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 15px rgba(255, 217, 95, 0.5);
}

.quality-display {
    text-align: center;
    font-size: 2.5em;
    margin: 15px 0;
    color: #FFD95F;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 217, 95, 0.4);
}

button {
    padding: 18px 45px;
    border: none;
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    color: #1a1b4b;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    font-family: "Play", sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: lowercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(255, 217, 95, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 217, 95, 0.5);
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sleep-log {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.log-entry {
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.4), rgba(75, 74, 77, 0.2));
    padding: 25px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #FFD95F;
    gap: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 217, 95, 0.1);
}

.log-entry:hover {
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.5), rgba(75, 74, 77, 0.3));
    border-left-color: #FFA500;
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(255, 217, 95, 0.2);
}

.log-entry > div:first-child {
    flex: 1;
}

.log-date {
    font-weight: 700;
    color: #FFD95F;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.log-stats {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 0.95em;
    opacity: 0.9;
}

.delete-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.3), rgba(255, 59, 48, 0.2));
    border: 2px solid rgba(255, 59, 48, 0.5);
    color: #ff6b6b;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.3em;
    transition: all 0.3s ease;
    min-width: auto;
}

.delete-btn:hover {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.5), rgba(255, 59, 48, 0.3));
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 5px 20px rgba(255, 59, 48, 0.4);
}

.leaderboard {
    display: grid;
    gap: 15px;
}

.leaderboard-entry {
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.4), rgba(75, 74, 77, 0.2));
    padding: 25px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 217, 95, 0.1);
}

.leaderboard-entry:hover {
    background: linear-gradient(135deg, rgba(75, 74, 77, 0.5), rgba(75, 74, 77, 0.3));
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(255, 217, 95, 0.2);
}

.leaderboard-entry.first {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
    border: 2px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.leaderboard-entry.first::before {
    content: '👑';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2em;
    animation: bounce 2s infinite;
}

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

.rank {
    font-size: 2.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 20px;
}

.cohort-section {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.points-display {
    font-size: 1.6em;
    color: #FFD95F;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 217, 95, 0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.25), rgba(255, 165, 0, 0.15));
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(255, 217, 95, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 217, 95, 0.1) 0%, transparent 70%);
    animation: statGlow 6s ease-in-out infinite;
}

@keyframes statGlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10%, 10%) rotate(180deg); }
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 217, 95, 0.4);
    border-color: #FFD95F;
}

.stat-value {
    font-size: 3em;
    font-weight: bold;
    color: #FFD95F;
    text-shadow: 0 0 20px rgba(255, 217, 95, 0.5);
    position: relative;
    z-index: 1;
}

.stat-label {
    margin-top: 15px;
    opacity: 0.9;
    font-size: 0.95em;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.hidden {
    display: none;
}

.success-message {
    background: linear-gradient(135deg, rgba(0, 255, 100, 0.25), rgba(0, 200, 80, 0.15));
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border: 2px solid rgba(0, 255, 100, 0.4);
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.5s ease;
}

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

@media (max-width: 768px) {
    body {
        padding-top: 140px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-btn {
        padding: 8px 20px;
        font-size: 0.85em;
    }
    
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 25px;
    }
    
    .log-entry {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .log-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .cohort-section {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 27, 75, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #FFA500, #FFD95F);
}

/* AI Chatbot Styles */
.ai-card {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(75, 0, 130, 0.15));
    border: 2px solid rgba(138, 43, 226, 0.3);
}

.ai-card:hover {
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 12px 40px rgba(138, 43, 226, 0.3);
}

.chat-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 217, 95, 0.1);
}

.chat-message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 15px;
    line-height: 1.6;
    animation: slideIn 0.3s ease;
}

.chat-message.user {
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.2), rgba(255, 165, 0, 0.15));
    text-align: right;
    border-left: 4px solid #FFD95F;
}

.chat-message.ai {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(75, 0, 130, 0.15));
    border-left: 4px solid #8a2be2;
}

.chat-message strong {
    color: #FFD95F;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: lowercase;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-input-container input {
    flex: 1;
}

.chat-input-container button {
    padding: 15px 30px;
    min-width: 100px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quick-btn {
    padding: 10px 20px;
    font-size: 0.9em;
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.15), rgba(255, 217, 95, 0.05));
    border: 2px solid rgba(255, 217, 95, 0.2);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Play", sans-serif;
    font-weight: 600;
    text-transform: lowercase;
}

.quick-btn:hover {
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.25), rgba(255, 217, 95, 0.15));
    border-color: #FFD95F;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 217, 95, 0.3);
}

.analysis-result {
    background: linear-gradient(135deg, rgba(255, 217, 95, 0.15), rgba(255, 165, 0, 0.1));
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #FFD95F;
    margin-top: 20px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.ai-tip {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15), rgba(75, 0, 130, 0.1));
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #8a2be2;
    margin-top: 20px;
    font-style: italic;
    opacity: 0.95;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FFD95F, #FFA500);
    border-radius: 10px;
}