/* Madurai Election 2026 - Modern Gradient Theme */

:root {
    /* Primary Gradient Colors */
    --primary-gradient: linear-gradient(
        to right,
        #FF671F 10%,
        #0002A1 100%
    );
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --info-gradient: linear-gradient(135deg, #30cfd0 0%, #330867 100%);

    /* Madurai Theme Colors */
    --madurai-saffron: #FF9933;
    --madurai-gold: #FFD700;
    --madurai-red: #DC143C;
    --madurai-green: #228B22;

    /* Neutral Colors */
    --dark-blue: #1e3c72;
    --light-blue: #2a5298;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
}

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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Poll Container */
.poll-container {
    padding: 40px 20px 60px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.poll-header {
    margin-bottom: 50px;
    color: white;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
    z-index: 2;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poll-title {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.poll-question {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    color: #fff;
    position: relative;
    display: inline-block;
}

.poll-question::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--warning-gradient);
    border-radius: 2px;
}

.poll-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
}

/* Party Cards */
.party-card {
    border-radius: 20px;
    border: none;
    background-color: transparent;
    overflow: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.party-card .card-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px 20px 0 0 !important;
    padding: 25px;
    font-weight: 700;
    font-size: 1.3rem;
    border: none;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.party-card .card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: translate(-50%, -50%); }
    100% { transform: translate(50%, 50%); }
}

.party-option {
    position: relative;
}

.party-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.party-label {
    cursor: pointer;
    display: block;
    height: 100%;
}

.party-card-inner {
    background: #fff;
    border: 3px solid transparent;
    border-radius: 16px;
    /* fixed size per request */
    width: 100%;
    min-height: 110px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* use box-sizing globally so padding is included in height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.party-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.party-card-inner:hover::before {
    left: 100%;
}

/* Selected State */
.party-option input[type="radio"]:checked + .party-label .party-card-inner {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.party-option input[type="radio"]:checked + .party-label .party-card-inner .party-icon {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.party-card-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.party-icon {
    font-size: 3rem;
    margin-bottom:8px;
    color: #667eea;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    /* container size for icon images */
    max-height: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.party-icon-img,
.party-icon img {
    width: 450px;
    height: 40px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.party-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* Form Controls */
.form-select,
.form-control {
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    padding: 14px 18px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    outline: none;
}

.form-label {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: #667eea;
    font-size: 1.2rem;
}

/* Gender Options */
.gender-option .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.gender-option .form-check-label {
    cursor: pointer;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.gender-option .form-check-label i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.gender-option input[type="radio"]:checked + .form-check-label {
    background: var(--primary-gradient);
    color: white;
    border-color: #667eea;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.gender-option input[type="radio"]:checked + .form-check-label i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.gender-option .form-check-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

/* Submit Button */
.btn-submit {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 700;
    padding: 18px 50px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4),
                0 0 0 0 rgba(102, 126, 234, 0.7);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6),
                0 0 0 15px rgba(102, 126, 234, 0.1);
    color: white;
}

.btn-submit:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.card {
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .poll-title {
        font-size: 1.8rem;
    }

    .poll-question {
        font-size: 1.4rem;
    }

    .poll-container {
        padding: 20px 0;
    }

    .party-card-inner {
        padding: 15px;
        width: 100%; /* allow full width on small screens */
        height: auto; /* let content dictate height when width shrinks */
    }

    .party-icon {
        font-size: 2rem;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Alert Messages */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Live Results Page */
.live-results-container {
    background: var(--primary-gradient);
    min-height: 100vh;
    padding: 50px 0;
}

.results-title {
    color: white;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.total-votes-badge {
    font-size: 1.2rem;
}

.section-title {
    color: white;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.party-stat-card {
    border-radius: 15px;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.party-stat-card:hover {
    transform: translateY(-5px);
}

.vote-percentage {
    font-size: 1.5rem;
}

.vote-count {
    font-size: 1.2rem;
    color: #6c757d;
}

/* Canvas for Charts */
canvas {
    max-width: 100%;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .no-print {
        display: none;
    }
}
