/**
 * WBCE Polls Module - Frontend CSS
 * 
 * @author BlackBird Webprogrammierung (assisted by Claude AI)
 * @version 1.1.1
 */

.mod_votes-container {
    max-width: 600px;
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}

.mod_votes-question h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

/* Voting Form */
.mod_votes-voting-form {
    margin-bottom: 20px;
}

.mod_votes-options {
    margin-bottom: 20px;
}

.mod_votes-option {
    margin-bottom: 12px;
    padding: 8px 0;
}

.mod_votes-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: background-color 0.2s;
    padding: 8px;
    border-radius: 4px;
}

.mod_votes-option label:hover {
    background-color: #f8f9fa;
}

.mod_votes-input {
    margin-right: 10px;
    margin-top: 0;
    transform: scale(1.1);
}

.mod_votes-option-text {
    flex: 1;
    color: #555;
}

/* Action Buttons */
.mod_votes-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.mod_votes-vote-btn,
.mod_votes-results-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.mod_votes-vote-btn {
    background: #007bff;
    color: white;
}

.mod_votes-vote-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

.mod_votes-results-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Results Display */
.mod_votes-results,
.mod_votes-results-display {
    margin-top: 20px;
}

.mod_votes-results h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.mod_votes-already-voted {
    color: #28a745;
    font-weight: 500;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.mod_votes-results-list {
    margin-bottom: 15px;
}

.mod_votes-result-item {
    margin-bottom: 15px;
}

.mod_votes-result-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
}

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

.mod_votes-result-stats {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.mod_votes-result-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.mod_votes-result-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
    min-width: 2px;
}

.mod_votes-total-votes {
    text-align: center;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 15px;
}

/* Messages */
.mod_votes-messages {
    margin-top: 15px;
}

.mod_votes-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.mod_votes-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mod_votes-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error states */
.mod_votes-not-found,
.mod_votes-error,
.mod_votes-no-votes {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mod_votes-container {
        margin: 10px;
        padding: 15px;
    }
    
    .mod_votes-question h3 {
        font-size: 16px;
    }
    
    .mod_votes-actions {
        flex-direction: column;
    }
    
    .mod_votes-vote-btn,
    .mod_votes-results-btn {
        width: 100%;
        text-align: center;
    }
    
    .mod_votes-result-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .mod_votes-result-stats {
        align-self: flex-end;
    }
}

/* Dark theme support (optional) */
@media (prefers-color-scheme: dark) {
    .mod_votes-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .mod_votes-question h3 {
        color: #f7fafc;
    }
    
    .mod_votes-option label:hover {
        background-color: #4a5568;
    }
    
    .mod_votes-option-text {
        color: #cbd5e0;
    }
    
    .option-text {
        color: #f7fafc;
    }
    
    .mod_votes-result-stats {
        color: #a0aec0;
    }
    
    .mod_votes-result-bar {
        background: #4a5568;
    }
    
    .mod_votes-total-votes {
        background: #4a5568;
        color: #cbd5e0;
    }
}

/* Zentrierung des Votes-Moduls (Erzwungen im Modul-CSS) */

/* 1. Zentriert den Haupt-Container als Block */
.mod_votes-container {
    max-width: 650px !important; /* ⬅️ WERT AN DIE BREITE ANPASSEN */
    width: 100% !important;
    margin: 0 auto !important; 
    display: block !important; 
}

/* 2. Zentriert den Inhalt des Containers (Text, Buttons, etc.) */
.mod_votes-container {
    text-align: center !important;
}

/* 3. Stellt sicher, dass die eigentlichen Optionen linksbündig bleiben */
/* Nur notwendig, wenn durch text-align: center die Radiobuttons mittig waren */
.mod_votes-container .mod_votes-options {
    text-align: left !important;
    /* Hilft, die Optionsliste als Ganzes zu zentrieren */
    display: inline-block !important; 
}
