*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

:root {
    --bg-color: #f5f7fb;
    --text-color: #222;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --border-color: #ddd;
    --muted-color: #666;
    --button-bg: #4f46e5;
}

body{
    background:var(--bg-color);
    color:var(--text-color);
    min-height:100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --card-bg: #1f2937;
    --header-bg: #111827;
    --border-color: #374151;
    --muted-color: #d1d5db;
    --button-bg: #7c3aed;
}


header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 5%;
    background:var(--header-bg);
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    position:sticky;
    top:0;
    z-index:100;
}

.header-actions{
    display:flex;
    align-items:center;
    gap:18px;
}

.page-content{
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px 20px 50px;
}

.hero-page{
    padding: 60px 20px 40px;
}

.about-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.about-card{
    text-align: left;
    padding: 24px;
}

.about-card h3{
    margin-bottom: 12px;
    color: var(--text-color);
}

.about-card p,
.about-card li{
    line-height: 1.7;
    color: var(--muted-color);
}

.about-card ul{
    padding-left: 20px;
}

.mission-card{
    margin-top: 10px;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-page {
        padding: 40px 10px 24px;
    }
}

.logo h1{
    color:#4f46e5;
    font-size:24px;
    line-height:1.2;
}

nav{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
    justify-content:center;
}

nav a{
    text-decoration:none;
    color:var(--text-color);
    font-weight:600;
}

nav a:hover{
    color:#4f46e5;
}

.hero{
    text-align:center;
    padding:80px 20px;
}

.hero h2{
    font-size:42px;
    margin-bottom:20px;
}

.hero p{
    max-width:700px;
    margin:auto;
    color:#666;
    line-height:1.7;
    font-size:18px;
}

.upload-section{
    display:flex;
    justify-content:center;
    padding:30px 20px;
}

.card{
    background:var(--card-bg);
    width:100%;
    max-width:650px;
    border-radius:20px;
    padding:24px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
    text-align:center;
}

.card h3{
    margin-bottom:20px;
}

input[type="file"]{
    width:100%;
    padding:12px;
    margin-bottom:20px;
    border:1px solid #ddd;
    border-radius:10px;
}

button{
    background:var(--button-bg);
    color:white;
    border:none;
    padding:12px 18px;
    border-radius:10px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
    min-height:44px;
}

button:hover{
    opacity:0.9;
}

#darkModeBtn {
    margin-left: 0;
    padding: 10px 12px;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.camera-switch-btn {
    margin-left: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #111827;
    border: 2px solid #4f46e5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.camera-status{
    min-height: 24px;
    margin-top: 12px;
    color: #b42318;
    font-size: 14px;
}

#confidenceScore {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted-color);
}

#seasonalType {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted-color);
}

.validation-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

.validation-message.error {
    background: rgba(180, 35, 24, 0.12);
    color: #b42318;
}

.validation-message.success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.recommendation-heading {
    font-weight: 700;
    margin-top: 10px;
    list-style: none;
}

.preview-section{
    display:flex;
    justify-content:center;
    margin-top:30px;
}

.preview-wrapper{
    display:none;
    justify-content:center;
    width:100%;
}

#previewImage{
    max-width:350px;
    width:100%;
    border-radius:20px;
    display:none;
    box-shadow:0 10px 25px rgba(0,0,0,0.15);
    object-fit:cover;
}

.camera-wrapper{
    display:none;
    justify-content:center;
    margin-top:16px;
}

#video{
    display:none;
    width:100%;
    max-width:400px;
    border-radius:15px;
    box-shadow:0 10px 25px rgba(0,0,0,0.15);
}

.capture-actions{
    display:flex;
    justify-content:center;
    margin-top:16px;
}

#captureBtn{
    display:none;
}

.results{
    padding:50px 20px;
    display:flex;
    justify-content:center;
}

.result-card{
    background:var(--card-bg);
    max-width:700px;
    width:100%;
    padding:30px;
    border-radius:20px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

.result-card h2{
    margin-bottom:20px;
}

#skinTone,
#hexColor,
#undertone{
    margin:15px 0;
    font-size:18px;
    font-weight:600;
}

.recommendations{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:20px;
    padding:20px 8%;
    margin-bottom:40px;
}

.recommend-card{
    background:var(--card-bg);
    padding:25px;
    border-radius:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
}

.recommend-card h3{
    margin-bottom:15px;
}

.recommend-card ul{
    padding-left:20px;
}

.recommend-card li{
    margin-bottom:8px;
}

.adsense-placeholder{
    text-align:center;
    padding:40px 20px;
}

.ad-box{
    max-width:1000px;
    margin:auto;
    height:120px;
    background:#ececec;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:15px;
    font-weight:bold;
}

footer{
    margin-top:40px;
    background:#111827;
    color:white;
    text-align:center;
    padding:25px;
}

@media(max-width:768px){

    header{
        flex-direction:column;
        gap:12px;
        padding:14px 4%;
    }

    .camera-controls{
        flex-direction:column;
        gap:10px;
    }

    .camera-controls button{
        width:100%;
    }

    .camera-switch-btn{
        width:100%;
    }

    .header-actions{
        flex-direction:column;
        gap:8px;
        width:100%;
    }

    nav{
        width:100%;
        justify-content:center;
        gap:10px;
    }

    .hero{
        padding:48px 16px 32px;
    }

    .hero h2{
        font-size:28px;
        line-height:1.2;
    }

    .hero p{
        font-size:15px;
        padding:0 4px;
    }

    .upload-section,
    .results,
    .recommendations{
        padding-left: 4%;
        padding-right: 4%;
    }

    .card,
    .result-card,
    .recommend-card{
        padding:18px;
    }

    .preview-section{
        margin-top:20px;
        padding:0 4%;
    }

    #previewImage{
        max-width:100%;
    }

    #video{
        max-width:100%;
    }

    #darkModeBtn{
        width:44px;
    }

}