/* style.css - Global Styles for BISCR School & College Voting System */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    position: relative; /* Needed for absolute positioning of icons */
}
.container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 25px;
}
.candidate-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.candidate-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}
.vote-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    background-color: #3b82f6; /* Blue-500 */
    color: white;
    border: none;
}
.vote-button:hover:not(:disabled) {
    background-color: #2563eb; /* Blue-600 */
    transform: translateY(-1px);
}
.vote-button:disabled {
    background-color: #9ca3af; /* Gray-400 */
    cursor: not-allowed;
}
.results-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #ecfdf5; /* Green-50 */
    border: 1px solid #d1fae5; /* Green-100 */
    border-radius: 8px;
}
.result-count {
    font-weight: 700;
    color: #059669; /* Green-600 */
    font-size: 1.1em;
}
.message-box {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
    text-align: center;
}
.message-box.success {
    background-color: #d1fae5; /* Green-100 */
    color: #065f46; /* Green-700 */
}
.message-box.error {
    background-color: #fee2e2; /* Red-100 */
    color: #991b1b; /* Red-700 */
}
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}
#video-container { /* Apply to both video containers */
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio (3/4 = 0.75) */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}
#video-feed, #face-canvas { /* Apply to all video/canvas elements */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure video covers the area */
}
#face-canvas { /* Apply to both canvases */
    background-color: transparent; /* Make canvas background transparent */
}
.voter-id-display {
    padding: 10px;
    background-color: #e0f2fe; /* Blue-50 */
    border: 1px solid #bfdbfe; /* Blue-100 */
    border-radius: 6px;
    font-weight: 600;
    color: #1e40af; /* Blue-800 */
    margin-top: 10px;
}

/* Styles for new icons and date/time */
.utility-icons {
    position: absolute;
    top: 20px;
    right: 20px; /* Position to the right */
    display: flex;
    gap: 10px; /* Add some space between icons */
    align-items: center;
    justify-content: flex-end; /* Justify content to the right */
    z-index: 10;
}
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6; /* Blue-500 - Changed to a vibrant blue */
}
.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.icon-button svg {
    width: 24px;
    height: 24px;
}
#datetime-display {
    font-size: 0.9em;
    color: #4b5563;
    font-weight: 500;
    text-align: center;
    /* flex-grow: 1; Removed as it's no longer needed for spacing */
}

/* Specific styles that were previously in index.php's <style> block */
#video-container {
    position: relative;
    width: 100%;
    max-width: 600px; /* Adjust as needed */
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #000;
}
#video-feed {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* Mirror the video for front camera */
}
#face-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1); /* Mirror the canvas to match video */
}
#recognition-status {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
    background-color: #e0f2fe; /* Light blue */
}
.face-recognition-section {
    background-color: #f0f9ff; /* Very light blue */
    border: 1px solid #bfdbfe; /* Blue-200 */
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

/* Style for the main "Scan Face" button */
#scan-face-button {
    background-color: #10b981; /* Green-500 */
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    margin-bottom: 25px; /* Space below the button */
}
#scan-face-button:hover {
    background-color: #059669; /* Green-600 */
    transform: translateY(-2px);
}
