/* File: style.css */
/* Import Font & CSS Variables */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --bg-color: #f8f9fa;
    --text-color: #2d3436;
    --card-bg: #ffffff;
    --pointer-color: #ff7675;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #6c5ce7; 
    --success-color: #00b894;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding-top: 60px;
    overflow-x: hidden;
}

.toolbar {
    position: fixed; top: 0; left: 0;
    width: 100%;
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex; justify-content: center; flex-wrap: wrap;
    padding: 10px 5px;
    z-index: 1000;
    gap: 10px;
}

.toolbar button {
    background: #f1f2f6; border: 1px solid #dfe4ea; font-size: 0.9rem;
    padding: 8px 16px; cursor: pointer; border-radius: 50px;
    transition: all 0.3s;
    font-weight: 600;
    color: #2f3542;
}

.toolbar button:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.app-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px; gap: 30px; width: 100%;
    box-sizing: border-box;
}

.wheel-section { display: flex; flex-direction: column; align-items: center; }

/* Kontainer Utama Roda - Menjaga Rasio Tetap Bulat */
.wheel-container {
    position: relative;
    width: 90vw; 
    max-width: 500px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.confetti-canvas {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none;
}

#wheelCanvas { 
    width: 100% !important; 
    height: 100% !important; 
    display: block;
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    left: -15px; 
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 40px solid var(--pointer-color); 
    z-index: 60;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}

.spin-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    width: 25%;
    height: 25%;
    min-width: 80px; 
    min-height: 80px;
    background-color: white;
    border-radius: 50%;
    display: flex; 
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    font-size: clamp(0.7rem, 2vw, 1rem); 
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    border: 3px solid #eee;
    box-shadow: 0 0 10px rgba(0,0,0,0.1) inset;
    z-index: 100; 
}

/* Controls Section */
.controls-section {
    width: 100%; max-width: 450px; background: var(--card-bg);
    padding: 25px; border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    box-sizing: border-box;
}

#namesTextarea {
    width: 100%; height: 180px; border: 2px solid #edf2f7;
    border-radius: 10px; padding: 12px; font-size: 1rem;
    resize: vertical; box-sizing: border-box;
}

/* Tombol Acak & Urutkan yang Diperbarui */
.entry-actions { display: flex; gap: 12px; margin: 15px 0; }

.entry-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dfe4ea;
    background-color: #f8f9fa;
    color: #4b4b4b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.entry-actions button:hover {
    background-color: #e2e8f0;
    border-color: var(--accent-color);
}

#spinButton {
    width: 100%; padding: 16px; font-size: 1.2rem; font-weight: 700;
    color: white; background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    border: none; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.button-danger {
    width: 100%; padding: 12px; margin-top: 15px;
    font-size: 0.9rem; font-weight: 600;
    color: #e74c3c; background-color: #fff5f5;
    border: 1px solid #ffcccc; border-radius: 8px;
    cursor: pointer;
}

.button-secondary {
    display: block; text-align: center; width: 100%;
    padding: 12px; margin-top: 10px; font-size: 0.9rem;
    color: #718096; border: 1px solid #edf2f7; border-radius: 8px;
    text-decoration: none; box-sizing: border-box;
}

/* Modal & Tombol Close */
.modal {
    display: none; position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
    background-color: #fff; padding: 30px; border-radius: 15px;
    width: 90%; max-width: 480px; position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.close-button {
    position: absolute; top: 15px; right: 20px;
    font-size: 28px; font-weight: bold; color: #cbd5e0;
    cursor: pointer; line-height: 1; transition: color 0.2s;
}

.close-button:hover { color: #e74c3c; }

.setting-item { margin-bottom: 20px; }
.themes-container { display: flex; gap: 10px; margin-top: 10px; }
.theme-option { width: 35px; height: 35px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.theme-option.active { border-color: #2d3436; }

@media (min-width: 992px) {
    .app-container { flex-direction: row; align-items: flex-start; justify-content: center; }
    .wheel-container { width: 500px; height: 500px; }
}