/* ============================================
   ÄÄNESTYSJÄRJESTELMÄ - PÄÄTYYLIT
   ============================================ */

/* PÄÄKONTAINER */
.aanestys-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* LIGHT THEME (Oletus) */
.aanestys-container.aanestys-theme-light {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.aanestys-container.aanestys-theme-light .aanestys-title {
    color: #2c3e50;
}

.aanestys-container.aanestys-theme-light .aanestys-description {
    color: #555555;
}

.aanestys-container.aanestys-theme-light .aanestys-option {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.aanestys-container.aanestys-theme-light .result-item {
    background-color: #f8f9fa;
}

/* DARK THEME */
.aanestys-container.aanestys-theme-dark {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.aanestys-container.aanestys-theme-dark .aanestys-title {
    color: #ffffff;
}

.aanestys-container.aanestys-theme-dark .aanestys-description {
    color: #b0b0b0;
}

.aanestys-container.aanestys-theme-dark .aanestys-option {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    color: #e0e0e0;
}

.aanestys-container.aanestys-theme-dark .result-item {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* ============================================
   OTSIKKO JA KUVAUS
   ============================================ */

.aanestys-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.aanestys-container.aanestys-theme-dark .aanestys-header {
    border-bottom-color: #333333;
}

.aanestys-title {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.3;
}

.aanestys-description {
    color: #666;
    line-height: 1.6;
    font-size: 1em;
    margin-top: 10px;
}

/* ============================================
   VAIHTOEHTOJEN LISTA
   ============================================ */

.aanestys-options {
    margin: 20px 0;
}

.aanestys-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 12px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.aanestys-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Hover - revontuliefekti */
.aanestys-container.aanestys-theme-dark .aanestys-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px 4px rgba(43,179,192,0.5); /* revontuli-sininen glow */
}

.aanestys-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-grow: 1;
    margin-right: 15px;
}

.aanestys-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.aanestys-container.aanestys-theme-light .aanestys-option input[type="radio"] {
    accent-color: #3498db;
}

.aanestys-container.aanestys-theme-dark .aanestys-option input[type="radio"] {
accent-color: var(--aurora-green);
}

.option-text {
    font-weight: 500;
    color: #333;
    flex-grow: 1;
}

.aanestys-container.aanestys-theme-dark .option-text {
    color: #e0e0e0;
}

.option-stats {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
    text-align: right;
}

.aanestys-container.aanestys-theme-dark .option-stats {
    color: #aaaaaa;
}

/* ============================================
   NAPPULAT (BUTTONS)
   ============================================ */

.aanestys-submit,
.suggestion-submit,
.aanestys-undo-vote {
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.aanestys-submit {
    display: block;
    width: 100%;
    background: #3498db;
    color: white;
}







.aanestys-submit:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.aanestys-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.suggestion-submit {
    background: #27ae60;
    color: white;
}

.suggestion-submit:hover {
    background: #219653;
    transform: translateY(-2px);
}

.aanestys-undo-vote {
    background: #e74c3c;
    color: white;
    font-size: 14px;
    padding: 10px 20px;
    margin-top: 10px;
}

.aanestys-undo-vote:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.aanestys-undo-vote:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Äänestysnapit Ideapaja-teemalla */
.aanestys-container.aanestys-theme-dark .aanestys-submit,
.aanestys-container.aanestys-theme-dark .suggestion-submit {
    background: linear-gradient(135deg, #2bb3c0, #1f3c88, #6fe3c1); /* revontuli-sävyt */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms cubic-bezier(0.4,0,1,1),
                box-shadow 150ms ease,
                background 0.25s ease;
    box-shadow: 0 6px 18px rgba(43,179,192,0.35);
}

/* Hover efekti */
.aanestys-container.aanestys-theme-dark .aanestys-submit:hover,
.aanestys-container.aanestys-theme-dark .suggestion-submit:hover {
    transform: scale(1);
    box-shadow: 0 10px 26px rgba(43,179,192,0.45);
}


/* ============================================
   ÄÄNESTYSTULOKSET
   ============================================ */

.aanestys-results {
    margin: 25px 0;
}

.result-item {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.result-item.user-vote {
    background-color: #f0f8ff;
    border-left: 4px solid #4CAF50;
}

.aanestys-container.aanestys-theme-dark .result-item.user-vote {
    background-color: rgba(76, 175, 80, 0.1);
    border-left-color: #4CAF50;
}

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

.result-text {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.result-numbers {
    font-size: 0.9em;
    color: #666;
    text-align: right;
}

.aanestys-container.aanestys-theme-dark .result-numbers {
    color: #aaaaaa;
}

.result-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.aanestys-container.aanestys-theme-dark .result-bar {
    background: #404040;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 5px;
    transition: width 1s ease-out;
}

.aanestys-container.aanestys-theme-dark .bar-fill {
    background: #4CAF50;
}

.total-votes {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
}

.aanestys-container.aanestys-theme-dark .total-votes {
    border-top-color: #333333;
}

/* Oma ääni -merkki */
.your-vote-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 8px;
    font-weight: 600;
}

.aanestys-container.aanestys-theme-dark .your-vote-badge {
    background: #2ecc71;
}

/* ============================================
   EHDOITUSLOMAKE
   ============================================ */

.aanestys-suggestion {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
}

.aanestys-container.aanestys-theme-dark .aanestys-suggestion {
    border-top-color: #404040;
}

.suggestion-toggle {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aanestys-container.aanestys-theme-dark .suggestion-toggle {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.suggestion-toggle:hover {
    background: #e9ecef;
}

.aanestys-container.aanestys-theme-dark .suggestion-toggle:hover {
    background: #3d3d3d;
}

.suggestion-form {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.aanestys-container.aanestys-theme-dark .suggestion-form {
    background: #2d2d2d;
    border-color: #404040;
}

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

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

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 1em;
    box-sizing: border-box;
}

.aanestys-container.aanestys-theme-dark .form-group textarea {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.aanestys-container.aanestys-theme-dark .form-group small {
    color: #aaaaaa;
}

/* ============================================
   VIESTIT JA ILMOITUKSET
   ============================================ */

.aanestys-errors,
.undo-message,
.suggestion-message {
    padding: 9px 9px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 0.95em;
}

/* Virheviestit */
.aanestys-errors,
.undo-message.error,
.suggestion-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.aanestys-container.aanestys-theme-dark .aanestys-errors,
.aanestys-container.aanestys-theme-dark .undo-message.error,
.aanestys-container.aanestys-theme-dark .suggestion-message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
    border-color: #c0392b;
}

/* Onnistumisviestit */
.undo-message.success,
.suggestion-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.aanestys-container.aanestys-theme-dark .undo-message.success,
.aanestys-container.aanestys-theme-dark .suggestion-message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border-color: #27ae60;
}

/* Ilmoituslaatikot */
.login-notice,
.already-voted,
.login-required,
.guest-notice {
    padding: 3px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
}

.login-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.already-voted {
    background: #f0f8ff;
        color: #2c3e50;
}

.login-required {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.guest-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    font-size: 0.9em;
    text-align: left;
}

/* Dark theme ilmoitukset */
.aanestys-container.aanestys-theme-dark .login-notice,
.aanestys-container.aanestys-theme-dark .guest-notice {
    background: #2d2d2d;
    border-color: #f39c12;
    color: #f1c40f;
}

.aanestys-container.aanestys-theme-dark .already-voted {
    background: #2d2d2d;
        color: #e0e0e0;
}

.aanestys-container.aanestys-theme-dark .login-required {
    background: var(--kerho-color);
    border-color: #000;
    color: #e0e0e0;
}

/* Kirjautumisnappi */
.aanestys-login-button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.aanestys-login-button:hover {
    background: #2980b9;
    color: white;
}

/* ============================================
   RESPONSIIVISUUS
   ============================================ */

@media (max-width: 600px) {
    .aanestys-container {
        padding: 15px;
        margin: 10px auto;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .aanestys-container.aanestys-theme-light {
        border: none;
        box-shadow: none;
    }
    
    .aanestys-container.aanestys-theme-dark {
        border: none;
        box-shadow: none;
    }
    
    .aanestys-option {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aanestys-option label {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .option-stats {
        margin-left: 0;
        margin-top: 5px;
        text-align: left;
        width: 100%;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-numbers {
        margin-top: 5px;
        text-align: left;
    }
    
    .aanestys-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
}

/* ============================================
   ADMIN-INFO (vain admin-näkymässä)
   ============================================ */

.aanestys-admin-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
}

.aanestys-container.aanestys-theme-dark .aanestys-admin-info {
    background: #2d2d2d;
    color: #aaaaaa;
}


/* assets/admin.css */
.aanestys-admin-options table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.aanestys-admin-options table th {
    text-align: left;
    padding: 10px;
    background: #f1f1f1;
    border-bottom: 2px solid #ddd;
}

.aanestys-admin-options table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.aanestys-admin-options table tr:hover {
    background: #f9f9f9;
}

.aanestys-admin-options input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.aanestys-admin-options input[type="number"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 80px;
}

.aanestys-admin-options .button-small {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
}

.aanestys-admin-options .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}