/* Lotto 6/45 AI Generator - Styles */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --dark-bg: #1a1a1a;
    --card-bg: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #3a3a3a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Section Styles */
section {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* Collapsible Header Styles */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
    padding: 10px;
    margin: -10px -10px 20px -10px;
    border-radius: 8px;
}

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

.collapse-icon {
    transition: transform 0.3s;
    font-size: 0.8em;
    color: var(--secondary-color);
}

.collapsed .collapse-icon {
    transform: rotate(90deg);
}

.config-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

.config-content.collapsed {
    max-height: 0;
    opacity: 0;
}

h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--dark-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.slider-item {
    background: var(--dark-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.slider-item label {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.config-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    transition: background 0.3s;
}

.config-slider:hover {
    background: #404040;
}

.config-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.config-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.config-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: none;
    transition: transform 0.2s;
}

.config-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.checkbox-item {
    flex-direction: row;
    align-items: center;
    background: var(--dark-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Weight Config */
.weight-config {
    background: var(--dark-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.weight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.weight-header h3 {
    margin: 0;
}

.random-weight-button {
    background: linear-gradient(135deg, #9b59b6, #e74c3c);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.random-weight-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.random-weight-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.random-weight-button.clicked {
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.weight-grid {
    display: grid;
    gap: 20px;
}

.weight-item {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    align-items: center;
    gap: 15px;
}

.weight-item label {
    color: var(--text-secondary);
}

.weight-item input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.weight-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.weight-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.weight-value {
    color: var(--secondary-color);
    font-weight: bold;
}

.weight-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

#weight-total-value {
    font-weight: bold;
    font-size: 1.3rem;
    transition: color 0.3s;
}

/* Button Styles */
.button-container {
    text-align: center;
    margin: 40px 0;
}

.generate-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.download-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-button.image-button {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
}

.generate-button:hover,
.download-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.generate-button .button-icon {
    font-size: 1.5rem;
}

.download-button .button-icon {
    font-size: 1rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s;
    text-align: center;
}

.results-container {
    display: grid;
    gap: 20px;
}

.result-set {
    background: var(--dark-bg);
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.result-set:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.set-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.numbers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.number-ball {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

/* 로또 번호 구간별 색상 (실제 로또 색상) */
.ball-yellow {
    background: linear-gradient(135deg, #ffc107, #ffb300);
}

.ball-blue {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.ball-red {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.ball-gray {
    background: linear-gradient(135deg, #757575, #616161);
}

.ball-green {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

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

.set-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Frequency Chart */
.frequency-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 250px;
    padding: 30px 15px 50px 15px;
    background: var(--dark-bg);
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
    margin-top: 20px;
}

.freq-bar {
    flex: 1;
    min-width: 22px;
    max-width: 30px;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    transition: transform 0.2s;
}

.freq-bar:hover {
    transform: translateY(-5px);
}

.bar-fill {
    width: 100%;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 3px 3px 0 0;
    transition: all 0.3s;
    min-height: 5px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bar-value {
    position: absolute;
    top: -25px;
    font-size: 0.7rem;
    color: var(--secondary-color);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 3px;
}

.freq-bar:hover .bar-value {
    opacity: 1;
}

.high-freq .bar-fill {
    background: linear-gradient(to top, var(--success-color), #2ecc71);
}

.mid-freq .bar-fill {
    background: linear-gradient(to top, var(--secondary-color), #f1c40f);
}

.low-freq .bar-fill {
    background: linear-gradient(to top, var(--danger-color), #c0392b);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 10px;
    margin-top: 40px;
}

.disclaimer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--danger-color);
    border-radius: 5px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto 15px;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    /* 통계 정보를 한 행에 표시 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-card h3 {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .slider-item {
        margin-bottom: 10px;
    }

    .weight-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .random-weight-button {
        width: 100%;
        justify-content: center;
    }

    .result-set {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 15px;
    }

    .numbers {
        justify-content: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .number-ball {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        color: white;
    }

    .set-number {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .set-stats {
        font-size: 0.8rem;
        margin-top: 10px;
    }

    .weight-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weight-item label {
        text-align: center;
    }

    .frequency-chart {
        height: 200px;
        padding: 20px 10px 40px 10px;
    }

    .freq-bar {
        min-width: 18px;
    }

    .bar-label {
        font-size: 0.65rem;
        bottom: -20px;
    }
}