* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Arial Unicode MS', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

#selectedCount {
    font-weight: bold;
    font-size: 1.2em;
}

.important-note {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    margin: 0;
    border-bottom: 3px solid #ff4757;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

.important-note p {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    direction: rtl;
    text-align: center;
    unicode-bidi: embed;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .important-note {
        padding: 15px 20px;
    }
    
    .important-note p {
        font-size: 1.1em;
    }
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.voting-section h2,
.results-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.deputies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
}

.deputy-card {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.deputy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.deputy-card.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.deputy-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e0e0e0;
}

.deputy-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.deputy-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    direction: rtl;
    text-align: center;
    unicode-bidi: embed;
}

.deputy-number {
    font-size: 0.9em;
    opacity: 0.8;
}

.checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    display: none;
}

.deputy-card.selected .checkmark {
    display: block;
}

.results-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.stats {
    margin-bottom: 20px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: 600;
    color: #667eea;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #764ba2;
}

.vote-counts {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.vote-item {
    background: white;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.vote-item:hover {
    transform: translateX(5px);
}

.vote-name {
    font-weight: 600;
    color: #333;
    direction: rtl;
    unicode-bidi: embed;
}

.vote-count {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 400px;
    position: relative;
}

.selected-section {
    background: #f8f9fa;
    padding: 30px;
    border-top: 3px solid #667eea;
}

.selected-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 50px;
}

.selected-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.remove-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.remove-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.no-selection {
    color: #999;
    font-style: italic;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Already Voted Message */
.already-voted-message {
    margin-bottom: 20px;
}

.voted-alert {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
    direction: rtl;
    unicode-bidi: embed;
}

.voted-alert strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.2em;
}

/* Google Ads Styling */
.ad-container {
    margin: 20px auto;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 2px dashed #e0e0e0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-top {
    margin: 20px 30px;
    min-height: 90px;
    max-width: 100%;
}

.ad-middle {
    margin: 20px 0;
    min-height: 100px;
    max-width: 100%;
}

.ad-sidebar {
    margin: 20px 0;
    min-height: 250px;
    max-width: 100%;
}

.ad-bottom {
    margin: 20px 30px;
    min-height: 90px;
    max-width: 100%;
}

.ad-placeholder {
    width: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
}

.ad-placeholder::before {
    content: "Advertisement";
    color: #ccc;
    font-style: italic;
}

/* Hide placeholder text when ad loads */
.adsbygoogle {
    display: block !important;
}

.adsbygoogle + .ad-placeholder::before {
    display: none;
}

@media (max-width: 768px) {
    .ad-container {
        margin: 15px;
        padding: 10px;
    }
    
    .ad-top,
    .ad-bottom {
        margin: 15px;
    }
    
    .ad-sidebar {
        min-height: 200px;
    }
}

/* Scrollbar styling */
.deputies-grid::-webkit-scrollbar,
.vote-counts::-webkit-scrollbar {
    width: 8px;
}

.deputies-grid::-webkit-scrollbar-track,
.vote-counts::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.deputies-grid::-webkit-scrollbar-thumb,
.vote-counts::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.deputies-grid::-webkit-scrollbar-thumb:hover,
.vote-counts::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
