/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 980px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== HEADINGS ===== */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

h3 {
    color: #333;
    margin-bottom: 15px;
}

/* ===== WHEEL ===== */
.wheel-container {
    position: relative;
    width: min(76vw, 460px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 30px;
}

.wheel-container canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 5px #fff, 0 0 0 11px #667eea, 0 18px 40px rgba(0,0,0,0.18);
}

.arrow {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #ff4444;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ===== INPUT GROUPS ===== */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    min-width: 150px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ===== RESULT BOX ===== */
.result-box {
    background: transparent;
    border-radius: 0;
    padding: 12px 20px;
    margin: 20px 0;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    border: none;
    box-shadow: none;
}

.result-box .winner {
    color: #764ba2;
    font-weight: 900;
    font-size: 1.45em;
    text-shadow:
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff,
        0 3px 10px rgba(118,75,162,0.35);
}

.result-box .already-spun {
    color: #764ba2;
    font-weight: 900;
    text-shadow:
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff,
        0 3px 10px rgba(118,75,162,0.35);
}

/* ===== STATUS MESSAGES ===== */
.status-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ADMIN LINKS ===== */
.admin-link {
    position: absolute;
    top: 18px;
    right: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-link a {
    color: #111;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.admin-link a:hover {
    text-decoration: underline;
}

.export-btn {
    color: #111;
}

/* ===== ADMIN STYLES ===== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header h1 {
    color: white;
    margin-bottom: 0;
    font-size: 1.8em;
}

.admin-header a {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-header a:hover {
    background: rgba(255,255,255,0.3);
}

.admin-header .logout-btn {
    background: rgba(255,0,0,0.3);
}

.admin-header .logout-btn:hover {
    background: rgba(255,0,0,0.5);
}

/* ===== LOGIN BOX ===== */
.login-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    margin: 50px auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.login-box h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: none;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
}

.login-box .btn {
    width: 100%;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ===== FORM GROUPS ===== */
.form-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.bulk-upload {
    border-top: 1px solid #eee;
    margin-top: 16px;
    padding-top: 16px;
}

.bulk-upload .form-group {
    margin-top: 12px;
    margin-bottom: 0;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f8f9fa;
}

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.icon-delete-btn {
    background: transparent;
    border: none;
    color: #764ba2;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
}

.icon-delete-btn:hover {
    color: #5a347f;
}

/* ===== EDIT FORM ===== */
.edit-form {
    display: none;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.edit-form.show {
    display: block;
}

/* ===== GRID ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== UTILITY ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .wheel-container {
        width: min(90vw, 520px);
    }
    
    .input-group input {
        min-width: 100px;
    }
    
    .form-group input,
    .form-group select {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .wheel-container {
        width: min(92vw, 360px);
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}
