/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --bg-color: #0a2540;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a2540 0%, #1a4d7a 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header .logo {
    max-width: 350px;
    width: 90%;
    height: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

header .subtitle {
    color: white;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Main Content */
main {
    flex: 1;
}

/* Info Banner */
.info-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    text-align: center;
}

.info-banner p {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.5;
}

.info-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: rgba(0, 102, 204, 0.05);
}

.info-link:hover {
    background-color: rgba(0, 102, 204, 0.1);
    transform: translateX(3px);
}

.info-link:active {
    transform: translateX(1px);
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-top: 16px;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Amount Buttons */
.amount-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.amount-btn {
    flex: 1;
    min-width: 80px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.amount-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.amount-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* Vote Section */
#voteSection {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

/* Vote Buttons */
.vote-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.vote-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.vote-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.vote-btn:active {
    transform: scale(0.98);
}

/* QR Code Display */
#qrContainer h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.4rem;
    color: var(--text-color);
}

#qrCodeDisplay {
    text-align: center;
    margin: 24px 0;
}

#qrCodeDisplay img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.info-box {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: center;
}

.info-box p {
    margin: 8px 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    background-color: #f8d7da;
    color: var(--error-color);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--error-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 40px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 20px;
    }

    .btn {
        padding: 12px 20px;
    }

    .info-banner {
        padding: 16px 18px;
        margin-bottom: 20px;
    }

    .info-banner p {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .info-link {
        font-size: 0.95rem;
        padding: 6px 12px;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 1.3rem;
    }

    .card {
        padding: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
