/**
 * DWF Hospitality - Enhanced Public Styles
 * Beautiful, modern, responsive design for voting forms
 * Version: 2.5.1 - Enhanced Design
 */

/* ============================================
   CSS VARIABLES & COLOR SCHEME
   ============================================ */
:root {
    --dwf-primary: #2563eb;
    --dwf-primary-hover: #1d4ed8;
    --dwf-success: #10b981;
    --dwf-error: #ef4444;
    --dwf-warning: #f59e0b;
    --dwf-star-color: #fbbf24;
    --dwf-star-empty: #d1d5db;
    
    --dwf-text-primary: #1f2937;
    --dwf-text-secondary: #6b7280;
    --dwf-text-muted: #9ca3af;
    
    --dwf-bg-white: #ffffff;
    --dwf-bg-gray: #f9fafb;
    --dwf-bg-gray-dark: #f3f4f6;
    
    --dwf-border: #e5e7eb;
    --dwf-border-hover: #d1d5db;
    
    --dwf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --dwf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --dwf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --dwf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --dwf-radius: 12px;
    --dwf-radius-sm: 8px;
    --dwf-transition: all 0.3s ease;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.dwf-voting-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   VENUE HEADER
   ============================================ */
.dwf-venue-header {
    background: var(--dwf-bg-white);
    border-radius: var(--dwf-radius);
    box-shadow: var(--dwf-shadow-lg);
    padding: 40px;
    margin-bottom: 30px;
}

.dwf-venue-hero {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.dwf-venue-logo {
    flex-shrink: 0;
}

.dwf-venue-logo img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--dwf-radius-sm);
    box-shadow: var(--dwf-shadow);
}

.dwf-venue-info {
    flex-grow: 1;
}

.dwf-venue-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--dwf-text-primary);
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.dwf-venue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.dwf-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dwf-text-secondary);
    font-size: 14px;
}

.dwf-meta-link {
    text-decoration: none;
    color: var(--dwf-primary);
    transition: var(--dwf-transition);
}

.dwf-meta-link:hover {
    color: var(--dwf-primary-hover);
}

.dwf-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   VENUE STATISTICS
   ============================================ */
.dwf-venue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 30px;
    border-top: 2px solid var(--dwf-border);
}

.dwf-stat-card {
    text-align: center;
    padding: 20px;
    background: var(--dwf-bg-gray);
    border-radius: var(--dwf-radius-sm);
    transition: var(--dwf-transition);
}

.dwf-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dwf-shadow);
}

.dwf-stat-primary {
    background: linear-gradient(135deg, var(--dwf-primary) 0%, var(--dwf-primary-hover) 100%);
    color: white;
}

.dwf-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--dwf-text-primary);
    margin-bottom: 8px;
}

.dwf-stat-primary .dwf-stat-value {
    color: white;
}

.dwf-stat-label {
    font-size: 14px;
    color: var(--dwf-text-secondary);
    font-weight: 500;
}

.dwf-stat-primary .dwf-stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.dwf-stat-stars {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

/* ============================================
   STAR DISPLAYS
   ============================================ */
.dwf-stars-display {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.dwf-stars-display svg {
    width: 24px;
    height: 24px;
}

.dwf-star-filled {
    fill: var(--dwf-star-color);
}

.dwf-star-half {
    fill: var(--dwf-star-color);
}

.dwf-star-empty {
    fill: var(--dwf-star-empty);
}

.dwf-stat-primary .dwf-star-filled,
.dwf-stat-primary .dwf-star-half {
    fill: white;
}

.dwf-stat-primary .dwf-star-empty {
    fill: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MESSAGES
   ============================================ */
.dwf-messages {
    margin-bottom: 20px;
}

.dwf-message {
    padding: 16px 20px;
    border-radius: var(--dwf-radius-sm);
    margin-bottom: 15px;
    display: flex;
    align-items: start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dwf-message-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--dwf-success);
}

.dwf-message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--dwf-error);
}

.dwf-message-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--dwf-warning);
}

/* ============================================
   FORM WRAPPER
   ============================================ */
.dwf-vote-form-wrapper {
    background: var(--dwf-bg-white);
    border-radius: var(--dwf-radius);
    box-shadow: var(--dwf-shadow-lg);
    padding: 40px;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.dwf-form-progress {
    margin-bottom: 30px;
}

.dwf-progress-bar {
    height: 8px;
    background: var(--dwf-bg-gray-dark);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.dwf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dwf-primary) 0%, var(--dwf-primary-hover) 100%);
    transition: width 0.4s ease;
    border-radius: 999px;
}

.dwf-progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--dwf-text-secondary);
    font-weight: 500;
}

/* ============================================
   FORM SECTIONS
   ============================================ */
.dwf-form-section {
    display: none;
}

.dwf-form-section.dwf-section-active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dwf-section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--dwf-border);
}

.dwf-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dwf-text-primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.dwf-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--dwf-primary);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
}

.dwf-section-description {
    color: var(--dwf-text-secondary);
    font-size: 15px;
    margin: 0;
}

/* ============================================
   FORM FIELDS
   ============================================ */
.dwf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dwf-form-group {
    margin-bottom: 20px;
}

.dwf-label {
    display: block;
    font-weight: 600;
    color: var(--dwf-text-primary);
    margin-bottom: 8px;
    font-size: 15px;
}

.dwf-required {
    color: var(--dwf-error);
}

.dwf-input,
.dwf-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--dwf-border);
    border-radius: var(--dwf-radius-sm);
    font-size: 15px;
    color: var(--dwf-text-primary);
    transition: var(--dwf-transition);
    font-family: inherit;
}

.dwf-input:focus,
.dwf-textarea:focus {
    outline: none;
    border-color: var(--dwf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dwf-input::placeholder,
.dwf-textarea::placeholder {
    color: var(--dwf-text-muted);
}

.dwf-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   STAR RATING INPUT
   ============================================ */
.dwf-ratings-grid {
    display: grid;
    gap: 25px;
}

.dwf-rating-item {
    padding: 20px;
    background: var(--dwf-bg-gray);
    border-radius: var(--dwf-radius-sm);
    transition: var(--dwf-transition);
}

.dwf-rating-item:hover {
    background: var(--dwf-bg-gray-dark);
}

.dwf-rating-label {
    display: block;
    font-weight: 600;
    color: var(--dwf-text-primary);
    margin-bottom: 12px;
    font-size: 16px;
}

.dwf-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.dwf-star-rating input[type="radio"] {
    display: none;
}

.dwf-star-rating .dwf-star {
    cursor: pointer;
    transition: var(--dwf-transition);
}

.dwf-star-icon {
    width: 36px;
    height: 36px;
    fill: var(--dwf-star-empty);
    transition: var(--dwf-transition);
}

.dwf-star-rating .dwf-star:hover .dwf-star-icon,
.dwf-star-rating .dwf-star:hover ~ .dwf-star .dwf-star-icon,
.dwf-star-rating input[type="radio"]:checked ~ .dwf-star .dwf-star-icon {
    fill: var(--dwf-star-color);
    transform: scale(1.1);
}

.dwf-rating-value {
    font-size: 14px;
    color: var(--dwf-text-secondary);
    font-weight: 500;
    min-height: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.dwf-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--dwf-border);
}

.dwf-actions-split {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.dwf-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--dwf-radius-sm);
    cursor: pointer;
    transition: var(--dwf-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.dwf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dwf-btn-next,
.dwf-btn-submit {
    background: linear-gradient(135deg, var(--dwf-primary) 0%, var(--dwf-primary-hover) 100%);
    color: white;
    box-shadow: var(--dwf-shadow);
}

.dwf-btn-next:hover:not(:disabled),
.dwf-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--dwf-shadow-lg);
}

.dwf-btn-back {
    background: var(--dwf-bg-gray);
    color: var(--dwf-text-primary);
}

.dwf-btn-back:hover:not(:disabled) {
    background: var(--dwf-bg-gray-dark);
}

.dwf-btn-submit {
    position: relative;
}

.dwf-btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.dwf-btn-submit.loading .dwf-btn-text {
    display: none;
}

.dwf-btn-submit.loading .dwf-btn-loader {
    display: block;
}

/* ============================================
   QR CODE SECTION
   ============================================ */
.dwf-qr-section {
    margin-top: 30px;
    text-align: center;
}

.dwf-qr-container {
    display: inline-block;
    padding: 30px;
    background: var(--dwf-bg-white);
    border-radius: var(--dwf-radius);
    box-shadow: var(--dwf-shadow-lg);
}

.dwf-qr-code {
    width: 200px;
    height: 200px;
    border-radius: var(--dwf-radius-sm);
    margin-bottom: 15px;
}

.dwf-qr-text {
    font-size: 14px;
    color: var(--dwf-text-secondary);
    margin: 0;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .dwf-voting-container {
        padding: 15px;
    }
    
    .dwf-venue-header {
        padding: 25px 20px;
    }
    
    .dwf-venue-hero {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .dwf-venue-logo img {
        width: 100px;
        height: 100px;
    }
    
    .dwf-venue-title {
        font-size: 26px;
    }
    
    .dwf-venue-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .dwf-venue-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dwf-vote-form-wrapper {
        padding: 25px 20px;
    }
    
    .dwf-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dwf-section-title {
        font-size: 20px;
    }
    
    .dwf-actions-split {
        flex-direction: column;
    }
    
    .dwf-btn {
        width: 100%;
    }
    
    .dwf-star-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .dwf-venue-header {
        padding: 20px 15px;
    }
    
    .dwf-venue-title {
        font-size: 22px;
    }
    
    .dwf-vote-form-wrapper {
        padding: 20px 15px;
    }
    
    .dwf-stat-value {
        font-size: 28px;
    }
    
    .dwf-star-icon {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .dwf-form-actions,
    .dwf-qr-section {
        display: none;
    }
    
    .dwf-voting-container {
        box-shadow: none;
    }
}


/* ============================================
   TEMPORARY TEST FEATURE: PRIZE WHEEL
   Shown after a successful vote. Remove this whole
   block (and the JS) to disable the feature.
   ============================================ */

.dwf-wheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.dwf-wheel-modal {
    background: var(--dwf-bg-white);
    border-radius: var(--dwf-radius);
    box-shadow: var(--dwf-shadow-xl);
    padding: 30px 24px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.dwf-wheel-title {
    margin: 0 0 6px;
    font-size: 24px;
    color: var(--dwf-text-primary);
}

.dwf-wheel-subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    color: var(--dwf-text-secondary);
}

.dwf-wheel-stage {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 20px;
}

/* Pointer sits at the top, pointing down into the wheel */
.dwf-wheel-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 26px solid var(--dwf-text-primary);
    z-index: 3;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.dwf-wheel {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 8px solid var(--dwf-bg-white);
    box-shadow: 0 0 0 4px var(--dwf-border), var(--dwf-shadow-lg);
    /* Long, eased spin */
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    transform: rotate(0deg);
}

/* Small hub in the center of the wheel */
.dwf-wheel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--dwf-bg-white);
    border: 4px solid var(--dwf-border);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Full-size layer that rotates around the wheel center */
.dwf-wheel-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    pointer-events: none;
}

/* Text sits on the vertical centerline, pushed out from the hub.
   Because the layer rotates to the segment's midpoint, the label
   ends up centered within its wedge. */
.dwf-wheel-label span {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 40px;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.dwf-wheel-result {
    min-height: 28px;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.dwf-wheel-result-show {
    opacity: 1;
}

.dwf-wheel-close {
    background: var(--dwf-primary);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--dwf-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--dwf-transition);
}

.dwf-wheel-close:hover {
    background: var(--dwf-primary-hover);
}

@media (max-width: 400px) {
    .dwf-wheel-stage,
    .dwf-wheel {
        width: 260px;
        height: 260px;
    }
}


/* ============================================
   CONSENT CHECKBOXES
   ============================================ */

.dwf-consent-group {
    border-top: 1px solid var(--dwf-border);
    padding-top: 16px;
}

.dwf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dwf-text-secondary);
}

.dwf-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--dwf-primary);
    cursor: pointer;
}


/* ============================================
   TERMS & CONDITIONS MODAL
   ============================================ */

.dwf-terms-link {
    color: var(--dwf-primary);
    text-decoration: underline;
}

.dwf-terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dwf-terms-content {
    background: var(--dwf-bg-white);
    border-radius: var(--dwf-radius);
    box-shadow: var(--dwf-shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.dwf-terms-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dwf-text-secondary);
    line-height: 1;
    padding: 4px 8px;
}

.dwf-terms-close:hover {
    color: var(--dwf-text-primary);
}

.dwf-terms-content h2 {
    margin: 0 0 20px;
    font-size: 22px;
    color: var(--dwf-text-primary);
}

.dwf-terms-body h3 {
    font-size: 15px;
    margin: 16px 0 6px;
    color: var(--dwf-text-primary);
}

.dwf-terms-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--dwf-text-secondary);
    margin: 0 0 10px;
}
