/* Admin Panel Styles */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #F5F5F5 0%, #E8F4F8 100%);
    min-height: 100vh;
    color: #333;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Wheel font size control - tidy UI */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.font-size-label {
    font-weight: 600;
    color: #0E4F6F;
    min-width: 160px;
}

.font-size-inputs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f7fbfd;
    border: 1px solid #d7e9f3;
    border-radius: 10px;
    padding: 6px 10px;
}

.font-size-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #cfe4ef;
    border-radius: 8px;
    outline: none;
}

.font-size-input:focus {
    border-color: #1FC7D4;
    box-shadow: 0 0 0 3px rgba(31, 199, 212, 0.15);
}

.font-size-unit {
    color: #4a788f;
    font-weight: 600;
}

.font-size-apply {
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.font-size-apply:hover {
    filter: brightness(1.05);
}

/* Login Form */
.login-form {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    background: rgb(255, 255, 255);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    color: #0E4F6F;
    margin-bottom: 30px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1FC7D4;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 199, 212, 0.4);
}

/* Admin Panel */
.admin-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-header {
    background: linear-gradient(135deg, #0E4F6F, #1FC7D4);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.admin-content {
    padding: 30px;
}

/* Sections */
.settings-section,
.prizes-section,
.preview-section,
.actions-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #F0F0F0;
}

.settings-section:last-child,
.prizes-section:last-child,
.preview-section:last-child,
.actions-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3,
.prizes-section h3,
.preview-section h3 {
    color: #0E4F6F;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-btn {
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 199, 212, 0.4);
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Prize List */
.prizes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prize-item {
    background: #F8F9FA;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    padding: 15px;
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr auto;
    gap: 10px;
    align-items: end;
    transition: all 0.3s ease;
}

.prize-item:hover {
    border-color: #1FC7D4;
    box-shadow: 0 4px 15px rgba(31, 199, 212, 0.1);
}

.prize-item input,
.prize-item select {
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.prize-item input:focus,
.prize-item select:focus {
    outline: none;
    border-color: #1FC7D4;
}

.prize-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prize-field label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prize-item input:invalid {
    border-color: #FF6B6B;
}

.color-input {
    width: 80px;
    height: 50px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Small Input Styles */
.small-input {
    padding: 6px 8px !important;
    font-size: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.small-color {
    width: 40px !important;
    height: 35px !important;
}

.small-select {
    padding: 6px 8px !important;
    font-size: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

/* Bin Button */
.bin-btn {
    background: #f71212 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.bin-btn:hover {
    background: #ff3742 !important;
    transform: scale(1.05) !important;
}

.remove-btn {
    background: #ff5454;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #FF5252;
    transform: translateY(-1px);
}

/* Preview */
.preview-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #F8F9FA;
    border-radius: 10px;
}

.preview-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* History Section */
.history-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #F0F0F0;
}

.history-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.history-controls input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
}

.refresh-btn {
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(31, 199, 212, 0.4);
}

.history-container {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    background: #F8F9FA;
}

.history-list {
    padding: 15px;
}

.history-item {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #1FC7D4;
    box-shadow: 0 2px 8px rgba(31, 199, 212, 0.1);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-prize {
    font-weight: 600;
    color: #0E4F6F;
    font-size: 16px;
}

.history-details {
    text-align: right;
    font-size: 14px;
    color: #666;
}

.history-time {
    font-weight: 500;
    margin-bottom: 5px;
}

.history-ip {
    font-family: monospace;
    background: #F0F0F0;
    padding: 2px 6px;
    border-radius: 4px;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Prize Count Summary */
.prize-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.prize-summary h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.prize-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.prize-count {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #1FC7D4;
    font-size: 14px;
}

.prize-count strong {
    color: #495057;
}

.history-items {
    max-height: 400px;
    overflow-y: auto;
}

/* Actions */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.save-btn {
    background: linear-gradient(135deg, #28A745, #20C997);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.save-status {
    text-align: center;
    font-weight: 500;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.save-status.success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.save-status.error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .prize-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .prize-field {
        gap: 3px;
    }
    
    .prize-field label {
        font-size: 11px;
    }
    
    .preview-wheel {
        width: 150px;
        height: 150px;
    }
}

/* Quota Section Styling */
.quota-section {
    margin-bottom: 30px;
}

.quota-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.quota-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.quota-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
    background: white;
    transition: all 0.3s ease;
}

.quota-item.available {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.quota-item.exhausted {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.quota-item.unlimited {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.quota-prize {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quota-icon {
    font-size: 18px;
    font-weight: bold;
    width: 24px;
    text-align: center;
}

.quota-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.quota-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.quota-count {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.quota-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quota-item.available .quota-label {
    color: #155724;
}

.quota-item.exhausted .quota-label {
    color: #721c24;
}

.quota-item.unlimited .quota-label {
    color: #0c5460;
}

.no-quota {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}