/**
 * CDC Wine & Event Rating - Frontend Styles
 * Mobile-first design
 */

/* Reset & Base */
.cdc-rating-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.cdc-rating-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 100vh;
}

/* Header */
.cdc-vote-header,
.cdc-live-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #8b1538;
    margin-bottom: 30px;
}

.cdc-vote-header h1,
.cdc-live-header h1 {
    font-size: 24px;
    margin: 0 0 10px;
    color: #8b1538;
}

.cdc-producer {
    font-size: 18px;
    font-weight: 600;
    color: #555;
    margin: 5px 0;
}

.cdc-date {
    font-size: 14px;
    color: #777;
    margin: 5px 0;
}

/* Live indicator */
.cdc-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e74c3c;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

.cdc-live-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sections */
.cdc-section {
    margin: 30px 0;
}

.cdc-section h2 {
    font-size: 20px;
    margin: 0 0 20px;
    color: #8b1538;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Rating Items */
.cdc-rating-item {
    margin-bottom: 25px;
}

.cdc-rating-item label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

/* Stars */
.cdc-stars {
    display: flex;
    gap: 8px;
    font-size: 32px;
    cursor: pointer;
}

.cdc-star {
    color: #ddd;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}

.cdc-star-filled,
.cdc-star-hover {
    color: #ffc107;
}

.cdc-star:hover {
    transform: scale(1.1);
}

/* Wine Items */
.cdc-wine-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cdc-wine-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.cdc-wine-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.cdc-wine-info {
    flex: 1;
}

.cdc-wine-info h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}

/* Buttons */
.cdc-btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.cdc-btn-primary {
    background: #8b1538;
    color: #fff;
}

.cdc-btn-primary:hover {
    background: #6d1029;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
}

.cdc-btn-secondary {
    background: #fff;
    color: #8b1538;
    border: 2px solid #8b1538;
}

.cdc-btn-secondary:hover {
    background: #8b1538;
    color: #fff;
}

/* Form Footer */
.cdc-form-footer {
    text-align: center;
    margin: 40px 0 20px;
    padding-bottom: 100px;
}

.cdc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #8b1538;
    font-size: 16px;
}

.cdc-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b1538;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.cdc-message {
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    font-size: 16px;
}

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

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

/* Success Page */
.cdc-vote-success {
    text-align: center;
    padding: 40px 20px;
}

.cdc-success-icon {
    color: #28a745;
    margin-bottom: 20px;
}

.cdc-vote-success h1 {
    font-size: 32px;
    color: #28a745;
    margin: 0 0 15px;
}

.cdc-success-message {
    font-size: 18px;
    color: #555;
    margin: 0 0 30px;
}

.cdc-event-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.cdc-event-details h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
}

/* Error Page */
.cdc-error-content {
    text-align: center;
    padding: 40px 20px;
}

.cdc-error-icon {
    color: #e74c3c;
    margin-bottom: 20px;
}

.cdc-error-content h1 {
    font-size: 28px;
    color: #e74c3c;
    margin: 0 0 15px;
}

.cdc-error-message {
    font-size: 16px;
    color: #555;
    margin: 0 0 15px;
}

.cdc-error-hint {
    font-size: 14px;
    color: #777;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* Live Results */
.cdc-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .cdc-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 640px) {
    .cdc-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.cdc-rating-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.cdc-rating-card h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cdc-rating-value {
    font-size: 36px;
    font-weight: 700;
    color: #8b1538;
    margin: 10px 0;
}

.cdc-stars-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 20px;
    margin: 10px 0;
}

.cdc-stars-display .cdc-star-filled {
    color: #ffc107;
}

.cdc-stars-display .cdc-star-half {
    color: #ffc107;
    opacity: 0.5;
}

.cdc-stars-display .cdc-star-empty {
    color: #ddd;
}

.cdc-vote-count {
    font-size: 12px;
    color: #999;
}

/* Wine Rankings */
.cdc-wine-rankings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cdc-wine-ranking-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    align-items: center;
}

.cdc-ranking-position {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8b1538;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.cdc-wine-details {
    flex: 1;
}

.cdc-wine-details h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}

.cdc-wine-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.cdc-wine-rating .cdc-rating-value {
    font-size: 24px;
    font-weight: 700;
    color: #8b1538;
    margin: 0;
}

/* Total Votes */
.cdc-total-votes {
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-top: 30px;
    font-size: 16px;
    color: #555;
}

/* Loading */
.cdc-loading-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Notices */
.cdc-notice {
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

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

/* Responsive */
@media (max-width: 600px) {
    .cdc-rating-container {
        padding: 15px;
    }
    
    .cdc-vote-header h1,
    .cdc-live-header h1 {
        font-size: 20px;
    }
    
    .cdc-stars {
        font-size: 28px;
        gap: 6px;
    }
}
