:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --background-color: #f0f2f5;
    --text-color: #333;
    --white: #fff;
    --container-bg: #fff;
    --shadow: rgba(0,0,0,0.1);
}

[data-theme='dark'] {
    --primary-color: #64b5f6;
    --secondary-color: #81c784;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --white: #fff;
    --container-bg: #1e1e1e;
    --shadow: rgba(0,0,0,0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    text-align: center;
    padding: 2rem;
    background-color: var(--container-bg);
    border-radius: 1rem;
    box-shadow: 0 10px 20px var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: var(--white);
}

.numbers-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.number:hover {
    transform: scale(1.1);
}

.generate-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.divider {
    border: none;
    border-top: 2px solid var(--background-color);
    margin: 3rem 0;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2rem;
}

/* Upload Styles */
.upload-container {
    margin-bottom: 2rem;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    border: 2px dashed var(--primary-color);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Preview Styles */
.preview-container {
    margin-bottom: 2rem;
    max-width: 100%;
}

#image-preview {
    max-width: 300px;
    border-radius: 1rem;
    box-shadow: 0 4px 10px var(--shadow);
}

/* Result Styles */
.result-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-label {
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    background-color: var(--background-color);
    height: 1.5rem;
    border-radius: 1rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease-out;
}

.loading-text {
    font-style: italic;
    color: var(--primary-color);
}
