@charset "UTF-8";

/* Add smooth scrolling to the html element */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial;
    background: var(--bg-color);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    display: flex;
    padding-top: 10px;
    min-width: 800px;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    min-width: 800px;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 10px;
    padding: 0 20px 20px 20px;
}

.page-header h1 {
    color: var(--font-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.page-header p {
    color: var(--font-color);
    opacity: 0.8;
    font-size: 16px;
    margin: 0;
}

/* Main raffle container */
.raffle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1200px; /* Make sure this matches */
    margin-bottom: 30px;
}

/* Section styling */
.entrants-section,
.drawing-section {
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    color: var(--font-color);
    margin: 0;
    font-size: 20px;
}

.entrant-count {
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

/* Add entrant section */
.add-entrant {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--font-color);
}

.input-group input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.input-group button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.input-group button:hover {
    background: linear-gradient(135deg, #218838, #1ba085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.input-group button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.bulk-actions button {
    padding: 10px 16px;
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.bulk-actions button:hover {
    background: var(--border-color);
}

/* Entrants list */
.entrants-list-container {
    max-height: 400px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: visible; /* Changed from hidden to visible for tooltips */
    position: relative;
    z-index: 1;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--border-color);
    font-weight: bold;
    color: var(--font-color);
    position: relative;
    z-index: 20; /* Increased z-index for tooltips */
    border-radius: 6px 6px 0 0; /* Add rounded corners to match container */
}

.list-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 25; /* Higher z-index for tooltip positioning */
}

.list-actions button {
    padding: 6px 12px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    position: relative;
    z-index: 30; /* Highest z-index to ensure tooltips appear above everything */
}

.list-actions button:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
}

.entrants-list {
    max-height: 350px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 0 0 6px 6px; /* Add rounded corners to match container */
    position: relative;
    z-index: 1;
}

.entrant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.entrant-item:hover {
    background: var(--content-bg-color);
}

.entrant-item.removed {
    opacity: 0.5;
    text-decoration: line-through;
}

.entrant-name {
    color: var(--font-color);
    font-size: 14px;
}

.entrant-actions {
    display: flex;
    gap: 5px;
}

.entrant-actions button {
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.entrant-actions button:hover {
    background: #c82333;
}

/* Drawing section */
.drawing-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawing-controls label {
    color: var(--font-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.current-drawing {
    margin-bottom: 20px;
}

.drawing-display {
    position: relative;
    background: var(--bg-color);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-display {
    width: 100%;
}

.winner-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--font-color);
    margin-bottom: 10px;
}

.winner-subtext {
    font-size: 14px;
    color: var(--font-color);
    opacity: 0.7;
}

.drawing-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color); /* Use the same background as drawing-display */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animation-text {
    color: var(--font-color);
    font-weight: bold;
}

.drawing-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.primary-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #218838, #1ba085);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

.primary-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.drawing-actions button:not(.primary-btn) {
    padding: 15px 25px;
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.drawing-actions button:not(.primary-btn):hover {
    background: var(--border-color);
}

/* Winners section */
.winners-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.winners-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.winners-header h4 {
    color: var(--font-color);
    margin: 0;
}

.winners-header button {
    padding: 8px 12px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.winners-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.winner-item:last-child {
    border-bottom: none;
}

.winner-position {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Dark theme override for winner position - make it darker in light mode */
:root {
    --winner-position-bg: #2c5aa0; /* Darker blue for light mode */
}

[data-theme="dark"] {
    --winner-position-bg: var(--accent-color); /* Use accent color in dark mode */
}

.winner-position {
    background: var(--winner-position-bg);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.winner-name {
    color: var(--font-color);
    font-weight: bold;
}

.winner-time {
    color: var(--font-color);
    opacity: 0.6;
    font-size: 12px;
}

.winner-actions {
    display: flex;
    gap: 5px;
}

.winner-actions button {
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.winner-actions button:hover {
    background: #c82333;
}

/* Statistics section */
.stats-section {
    width: 100%;
    max-width: 1200px; /* Match the main container width */
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.stats-section h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--font-color);
    font-size: 14px;
    opacity: 0.8;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--content-bg-color);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--font-color);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--font-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--font-color);
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.modal-footer button:not(.primary-btn) {
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
}

/* Instructions section */
.instructions-section {
    width: 100%;
    max-width: 1200px; /* Match the main container width */
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.instructions-section h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    text-align: center;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.instruction-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.instruction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instruction-number {
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.instruction-content h4 {
    color: var(--font-color);
    margin: 0 0 8px 0;
    font-size: 16px;
}

.instruction-content p {
    color: var(--font-color);
    opacity: 0.8;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--font-color);
    opacity: 0.6;
}

.empty-state p {
    margin: 5px 0;
}

.empty-state .hint {
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .raffle-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .list-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .drawing-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure tooltips appear above all containers */
.entrants-section {
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow: visible; /* Ensure tooltips can extend outside */
}

.drawing-section {
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow: visible; /* Ensure tooltips can extend outside */
}