:root {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --btn-bg: #4CAF50;
    --btn-hover: #45a049;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --nav-bg: #ffffff;
    --footer-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-primary: #f0f2f5;
    --text-secondary: #aaaaaa;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --btn-bg: #3d8c40;
    --btn-hover: #357a38;
    --input-bg: #3d3d3d;
    --input-border: #444444;
    --nav-bg: #2d2d2d;
    --footer-bg: #2d2d2d;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Navigation */
.main-nav {
    background-color: var(--nav-bg);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--btn-bg);
}

/* Container & Layout */
.container {
    text-align: center;
    background: var(--container-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 20px var(--shadow-color);
    transition: background-color 0.3s, box-shadow 0.3s;
    max-width: 800px;
    width: 90%;
    margin: 40px auto;
}

.page-content {
    margin-bottom: 60px;
}

.text-content {
    text-align: left;
}

.text-content h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.text-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--btn-bg);
}

.text-content section {
    margin-bottom: 30px;
}

.text-content ul {
    padding-left: 20px;
}

.text-content li {
    margin-bottom: 10px;
}

/* Tool Sections */
.header-top {
    margin-bottom: 20px;
}

h1 { font-size: 2em; margin: 0; }
h2 { font-size: 1.5em; margin-bottom: 20px; }

.tool-section { margin-bottom: 40px; }
.tool-section hr { border: none; border-top: 1px solid var(--input-border); margin-bottom: 30px; }

.tool-description {
    text-align: left;
    margin: 20px 0 30px;
    padding: 20px;
    background: rgba(128, 128, 128, 0.05);
    border-radius: 10px;
}

/* Lotto Styles */
.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    min-height: 70px;
}

/* Upload Styles */
.upload-container {
    margin: 20px auto;
    border: 2px dashed var(--input-border);
    border-radius: 15px;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--input-bg);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-container:hover {
    border-color: var(--btn-bg);
    background: rgba(76, 175, 80, 0.05);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TM Styles */
#label-container {
    margin: 20px auto;
    max-width: 400px;
}

.prediction-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.label-name { width: 80px; font-weight: 600; text-align: left; }
.progress-bar {
    flex-grow: 1;
    height: 20px;
    background-color: var(--input-border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease-out, background-color 0.3s;
}

.label-prob { width: 50px; font-size: 0.9em; font-weight: bold; }

/* Buttons */
.submit-btn {
    background-color: var(--btn-bg);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.submit-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.nav-btn { justify-content: center; margin-top: 10px; }

.back-link {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.back-link:hover { transform: translateX(-5px); }

#theme-toggle {
    background: none;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

#theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

/* Footer */
.main-footer {
    background-color: var(--footer-bg);
    padding: 40px 0;
    margin-top: auto;
    box-shadow: 0 -2px 4px var(--shadow-color);
    transition: background-color 0.3s;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9em;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--btn-bg);
}

/* Forms & Comments */
.partnership-section, .comments-section { margin-top: 40px; }
.form-group { margin-bottom: 15px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg); color: var(--text-primary);
}
.form-group textarea { height: 80px; }
#loading-spinner { margin-top: 10px; font-weight: 600; color: var(--btn-bg); }

@media (max-width: 600px) {
    .nav-links {
        gap: 10px;
    }
    .nav-links a {
        font-size: 0.9em;
    }
    .container {
        padding: 20px;
        width: 95%;
    }
}
