:root {
    --background-gradient: linear-gradient(-45deg, #f0f2f5, #e0e7ff, #fdf2f8, #f0f9ff);
    --container-color: rgba(255, 255, 255, 0.9);
    --text-color: #333333;
    --button-color: #4CAF50;
    --button-glow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --divider-color: rgba(0, 0, 0, 0.1);
    --toggle-bg: #ccc;
    --toggle-circle: #fff;
    --progress-bg: #eee;
}

.dark-mode {
    --background-gradient: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #1e293b);
    --container-color: rgba(44, 44, 44, 0.85);
    --text-color: #f0f0f0;
    --button-glow: 0 0 15px rgba(76, 175, 80, 0.7);
    --divider-color: rgba(255, 255, 255, 0.1);
    --toggle-bg: #4CAF50;
    --toggle-circle: #fff;
    --progress-bg: #444;
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background: var(--background-gradient);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: color 0.3s ease;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.dark-mode .theme-toggle-container {
    background: rgba(0, 0, 0, 0.3);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--toggle-bg);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px; width: 26px;
    left: 4px; bottom: 4px;
    background-color: var(--toggle-circle);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before { transform: translateX(26px); }

.container {
    background-color: var(--container-color);
    backdrop-filter: blur(10px);
    padding: 60px 40px 40px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 95%;
    max-width: 600px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    margin-bottom: 5px;
    opacity: 0.8;
}

.notice {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 10px;
}

.upload-area {
    border: 2px dashed var(--divider-color);
    border-radius: 20px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--divider-color);
    border-top: 4px solid var(--button-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.result-area {
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

.result-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--button-color);
}

.chart-container {
    margin-bottom: 30px;
    text-align: left;
}

.chart-item {
    margin-bottom: 15px;
}

.label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.progress-bar {
    background: var(--progress-bg);
    height: 15px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress {
    height: 100%;
    background-color: var(--button-color);
    transition: width 0.8s ease;
}

.percent {
    font-size: 0.8rem;
    opacity: 0.7;
}

.divider {
    height: 1px;
    background-color: var(--divider-color);
    margin: 40px 0;
    width: 100%;
}

.generate-button {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--button-glow);
}

.generate-button:hover { transform: translateY(-3px); opacity: 0.9; }

.partnership-section { text-align: left; }
.partnership-section h3 { text-align: center; margin-bottom: 20px; }
#partnership-form { display: flex; flex-direction: column; gap: 15px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--divider-color);
    background: rgba(255, 255, 255, 0.05); color: var(--text-color); font-family: inherit;
}
.submit-button {
    background-color: var(--button-color); color: white; border: none; padding: 12px;
    font-weight: bold; border-radius: 10px; cursor: pointer; transition: 0.3s;
}

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