@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: #f0fdf4; 
    color: #333;
    padding-top: 70px; /* Space for fixed navbar */
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #b91c1c;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-container {
    display: flex;
    max-width: 1000px;
    width: 100%;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    font-weight: 500;
    font-size: 16px;
    transition: background-color 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: #991b1b;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.banner-img {
    width: 100%;
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.system-title {
    color: #b91c1c; /* Red color matching the alert text */
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: #4b5563;
    font-size: 18px;
}

/* Voting Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 18px;
    font-weight: 500;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.option-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin-right: 15px;
}

/* Results */
.result-item {
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

.result-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.result-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-bar-container {
    height: 12px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.result-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.result-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6b7280;
    margin-top: 5px;
}

/* Admin Styles */
.admin-login {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background-color: #b91c1c;
    color: white;
    width: 100%;
}

.btn-secondary {
    background-color: #4b5563;
    color: white;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: #eab308;
    color: white;
}

.btn-warning:hover {
    background-color: #ca8a04;
}

.admin-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
}

.nav-links {
    text-align: center;
    margin-top: 30px;
}

.nav-links a {
    color: #4b5563;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.nav-links a:hover {
    color: #b91c1c;
}

/* Racing Bar Chart Styles */
.race-container {
    position: relative;
    height: 500px; /* will be adjusted dynamically */
    overflow: hidden;
}

.race-item {
    position: absolute;
    width: 100%;
    transition: transform 0.8s ease-in-out;
}

.result-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother racing bar */
}

.rank-icon {
    font-size: 24px;
    margin-right: 10px;
    display: inline-block;
    transition: transform 0.5s ease;
}

/* Add pulsing effect for top rank */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.rank-1 .rank-icon {
    animation: pulse 1s infinite;
}
