* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    overflow: hidden;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 700;
}

h2,
h3 {
    color: #34495e;
    margin-bottom: 20px;
}

p {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #7f8c8d;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Countdown Timer */
.countdown-timer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 600;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    transition: background 0.5s ease;
}

.countdown-timer.ended {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Form Styles */
.voting-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.voting-section {
    margin-top: 30px;
}

.option-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.option-group label {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
}

/* Radio Button Styles */
.rank-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.rank-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-label {
    font-size: 1em;
    color: #2c3e50;
    cursor: pointer;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 30px auto 0;
}

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

/* Results Styles */
.results-section {
    margin-bottom: 40px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.result-item:nth-child(2) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.result-item:nth-child(3) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.result-item:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.option-name {
    font-size: 1.3em;
}

.vote-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
}

.option-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vote-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vote-bubble {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.vote-bubble:hover {
    transform: scale(1.05);
}

.bubble-points {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.vote-bubble-container {
    position: relative;
    display: inline-block;
}

.delete-vote-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.delete-vote-btn:hover {
    background: #c82333;
    opacity: 1;
    transform: scale(1.1);
}

/* Detailed Votes */
.detailed-votes {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.votes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.user-votes {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-vote-details {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.vote-detail {
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    color: #495057;
}

/* User Votes Section */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.delete-person-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-person-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.user-votes {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

/* Links and Buttons */
.results-link,
.nav-link {
    text-align: center;
    margin: 30px 0;
}

.results-link a,
.nav-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.results-link a:hover,
.nav-link a:hover {
    background: #667eea;
    color: white;
}

.action-buttons {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 0 10px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Password Form Styles */
.password-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
    text-align: center;
}

.password-form .form-group {
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.password-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.password-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-link a:hover {
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-logo {
        width: 90px;
    }

    .option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .option-group select {
        width: 100%;
        min-width: auto;
    }

    .votes-grid {
        grid-template-columns: 1fr;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Header with Logo */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-logo {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Warning Modal */
#warning-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#warning-modal.show {
    display: flex;
}

#warning-modal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

#warning-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

#warning-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

#warning-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: scale(1.1);
}

#warning-modal-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

#warning-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 25px;
    font-weight: 500;
}

#warning-modal .modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

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

#warning-modal .modal-btn:active {
    transform: translateY(0);
}