/**
 * Frontend-Styles für Traber des Jahres
 */

/* Container */
.tdj-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.tdj-container h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px;
    text-align: center;
}

.tdj-subtitle {
    text-align: center;
    color: #64748b;
    margin: 0 0 30px;
    font-size: 16px;
}

/* Kandidaten-Grid (Karten) */
.tdj-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tdj-candidate-card {
    cursor: pointer;
    display: block;
}

.tdj-candidate-card input[type="radio"] {
    display: none;
}

.tdj-card-inner {
    position: relative;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tdj-candidate-card:hover .tdj-card-inner {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tdj-candidate-card input:checked + .tdj-card-inner {
    border-color: #709932;
    box-shadow: 0 0 0 3px rgba(112, 153, 50, 0.2);
}

.tdj-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdj-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdj-card-image.tdj-no-image .dashicons {
    font-size: 60px;
    color: #cbd5e1;
}

.tdj-card-content {
    padding: 20px;
}

.tdj-card-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.tdj-card-content p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.tdj-card-check {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #709932;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.tdj-card-check .dashicons {
    color: #fff;
    font-size: 18px;
}

.tdj-candidate-card input:checked + .tdj-card-inner .tdj-card-check {
    opacity: 1;
    transform: scale(1);
}

/* Kandidaten-Liste */
.tdj-candidates-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.tdj-candidate-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tdj-candidate-item:hover {
    border-color: #94a3b8;
}

.tdj-candidate-item input[type="radio"] {
    display: none;
}

.tdj-candidate-item input:checked ~ .tdj-radio-custom {
    border-color: #709932;
    background: #709932;
}

.tdj-candidate-item input:checked ~ .tdj-radio-custom::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.tdj-radio-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tdj-candidate-name {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
}

/* Gast-Formular */
.tdj-guest-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.tdj-guest-form h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #1e293b;
}

.tdj-guest-form .tdj-info {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
}

.tdj-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .tdj-form-row {
        grid-template-columns: 1fr;
    }
}

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

.tdj-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.tdj-form-group input[type="text"],
.tdj-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.tdj-form-group input:focus {
    outline: none;
    border-color: #709932;
}

.tdj-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

/* Eingeloggt-Info */
.tdj-logged-in-info {
    text-align: center;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 8px;
    color: #166534;
    margin-bottom: 20px;
}

/* Submit-Button */
.tdj-submit-wrap {
    text-align: center;
}

.tdj-submit-btn {
    display: inline-block;
    padding: 16px 50px;
    background: linear-gradient(135deg, #709932 0%, #5a7a28 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tdj-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(112, 153, 50, 0.4);
}

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

/* Nachrichten */
.tdj-message {
    text-align: center;
    padding: 40px 30px;
    border-radius: 12px;
}

.tdj-message-icon {
    margin-bottom: 15px;
}

.tdj-message-icon .dashicons {
    font-size: 50px;
    width: 50px;
    height: 50px;
}

.tdj-message h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.tdj-message p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.tdj-success {
    background: #f0fdf4;
}

.tdj-success .dashicons {
    color: #22c55e;
}

.tdj-success h3 {
    color: #166534;
}

.tdj-success p {
    color: #15803d;
}

.tdj-error {
    background: #fef2f2;
}

.tdj-error .dashicons {
    color: #ef4444;
}

.tdj-error h3 {
    color: #991b1b;
}

.tdj-error p {
    color: #b91c1c;
}

.tdj-info {
    background: #eff6ff;
}

.tdj-info .dashicons {
    color: #3b82f6;
}

.tdj-info h3 {
    color: #1e40af;
}

/* Ergebnisse */
.tdj-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tdj-result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
}

.tdj-result-item.tdj-winner {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.tdj-result-rank {
    width: 40px;
    height: 40px;
    background: #1e293b;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.tdj-winner .tdj-result-rank {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.tdj-result-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.tdj-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdj-result-info {
    flex: 1;
}

.tdj-result-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1e293b;
    text-align: left;
}

.tdj-result-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.tdj-votes {
    font-size: 14px;
    color: #64748b;
}

.tdj-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #709932;
}

.tdj-progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.tdj-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #709932 0%, #8fb848 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Modal */
.tdj-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tdj-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    animation: tdj-modal-in 0.3s ease;
}

@keyframes tdj-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tdj-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.tdj-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Hinweis-Box */
.tdj-notice {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .tdj-container h2 {
        font-size: 24px;
    }

    .tdj-candidates-grid {
        grid-template-columns: 1fr;
    }

    .tdj-result-item {
        flex-wrap: wrap;
    }

    .tdj-result-info {
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
}
