/* style.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 500px;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 20px;
    border: 1px solid #333;
}

h1, h2, h3 { color: #ffffff; text-align: center; }
h2 { margin-bottom: 25px; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #b3b3b3;
}

input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid #444;
    background-color: #2c2c2c;
    color: white;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
}

input[type="text"]:focus, input[type="email"]:focus, select:focus {
    border-color: #bb86fc;
}

button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 15px;
}

button:hover { 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 77, 255, 0.4);
}

button.secondary { background: #333; color: #e0e0e0; }
button.secondary:hover { background: #444; box-shadow: none; }

.option-row { display: flex; gap: 10px; }
.option-row button { width: 50px; background: #cf6679; margin-bottom: 20px;}

.settings-group {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.checkbox-row input { width: 20px; height: 20px; margin: 0; }
.checkbox-row label { margin: 0; color: white; cursor: pointer; }

.radio-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }

.radio-option {
    display: flex;
    align-items: center;
    background: #2c2c2c;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover { background: #353535; }
.radio-option input { margin-right: 15px; transform: scale(1.3); accent-color: #bb86fc; }
.radio-option:has(input:checked) {
    border-color: #bb86fc;
    background: rgba(187, 134, 252, 0.1);
}

.hidden { display: none !important; }
.message { text-align: center; margin-top: 15px; font-weight: bold; padding: 10px; border-radius: 8px;}
.error { color: #cf6679; background: rgba(207, 102, 121, 0.1); }
.success { color: #03dac6; background: rgba(3, 218, 198, 0.1); }

.code-display { font-size: 38px; letter-spacing: 8px; text-align: center; color: #bb86fc; margin: 25px 0; font-weight: 800;}
a { color: #bb86fc; }

@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-success {
    animation: successPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* =========================================================
   Resultate Styles
   ========================================================= */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 20px;
    background: #2a2a2a;
    border-radius: 12px;
    padding: 15px;
}

.votes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-card {
    background: #2c2c2c;
    border-radius: 10px;
    padding: 18px;
    /* Der Rand wird jetzt dynamisch von JS in der User-Farbe gesetzt */
    border-left: 4px solid transparent; 
    transition: background 0.3s;
}

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

.vote-name {
    font-size: 16px;
    font-weight: bold;
    /* Farbe wird von JS überschrieben */
}

.info-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3a3a3a;
    color: #b3b3b3;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    font-family: serif;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
    border: 1px solid #555;
}

.info-btn:hover {
    background: #bb86fc;
    color: white;
    border-color: #bb86fc;
    transform: none;
}

.vote-choice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.choice-pill {
    /* Farben, Rand und Hintergrund kommen jetzt dynamisch aus JS */
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.vote-time {
    font-size: 12px;
    color: #777;
}

.id-text {
    font-family: monospace;
    color: #7c4dff;
    background: #121212;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 5px;
}

/* =========================================================
   Modal (Overlay) & Validierungs-Icons
   ========================================================= */
.modal {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #444;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.close-modal {
    position: absolute;
    top: 15px; 
    right: 20px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover { color: #fff; }

.vote-info-details p {
    margin-bottom: 15px;
    font-size: 14px;
    color: #b3b3b3;
}

.ip-display-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    color: #121212;
}

.status-icon.valid { background-color: #03dac6; }
.status-icon.invalid { background-color: #ffb74d; }

.footer-note {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 30px;
    padding-bottom: 20px;
    width: 100%;
    max-width: 500px;
}

/* Ersetze .chart-container mit diesem Code: */

.ai-summary-card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #444;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.ai-header {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #bb86fc;
    display: inline-block;
    padding-bottom: 5px;
}

.ai-loading {
    color: #b3b3b3;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.ai-content {
    color: #e0e0e0;
    font-size: 15px;
    line-height: 1.6;
}

/* Formatierung für das Markdown der KI */
.ai-content p {
    margin-bottom: 12px;
}

.ai-content strong {
    color: #ffffff;
}

.ai-content ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.ai-footer {
    text-align: right;
    font-size: 11px;
    color: #666;
    margin-top: 20px;
    font-family: monospace;
    border-top: 1px dashed #444;
    padding-top: 10px;
}