/* Fan Forge Public Portal - Material UI & Tailwind Inspired */

:root {
    --ff-primary: #2563eb;
    --ff-primary-dark: #1d4ed8;
    --ff-primary-light: #3b82f6;
    --ff-success: #10b981;
    --ff-error: #ef4444;
    --ff-background: #f8fafc;
    --ff-surface: #ffffff;
    --ff-border: #e2e8f0;
    --ff-text-primary: #0f172a;
    --ff-text-secondary: #64748b;
    --ff-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ff-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --ff-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --ff-radius: 12px;
    --ff-spacing: 1rem;
}

.fan-forge-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--ff-background);
    min-height: 60vh;
    padding: 40px 20px;
}

.ff-portal-container {
    max-width: 800px;
    margin: 0 auto;
}

.ff-auth-required,
.ff-no-campaign {
    background: var(--ff-surface);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow-md);
    padding: 60px 40px;
    text-align: center;
}

.ff-auth-icon,
.ff-icon {
    margin: 0 auto 24px;
    color: var(--ff-primary);
}

.ff-auth-required h2,
.ff-no-campaign h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ff-text-primary);
    margin: 0 0 16px;
}

.ff-auth-required p,
.ff-no-campaign p {
    font-size: 1.125rem;
    color: var(--ff-text-secondary);
    margin-bottom: 32px;
}

.ff-auth-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.ff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-radius: var(--ff-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    min-width: 140px;
}

.ff-btn-primary {
    background: var(--ff-primary);
    color: white;
}

.ff-btn-primary:hover {
    background: var(--ff-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--ff-shadow-lg);
    color: white;
}

.ff-btn-secondary {
    background: transparent;
    color: var(--ff-primary);
    border: 2px solid var(--ff-primary);
}

.ff-btn-secondary:hover {
    background: var(--ff-primary);
    color: white;
}

.ff-btn-large {
    padding: 16px 48px;
    font-size: 1.125rem;
}

.ff-campaign-intro {
    background: var(--ff-surface);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow-md);
    padding: 48px;
    text-align: center;
}

.ff-welcome-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--ff-primary);
    margin: 0 auto 24px;
    box-shadow: 0 0 0 8px rgba(37,99,235,0.06);
}

.ff-campaign-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ff-text-primary);
    margin: 0 0 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ff-campaign-intro-text {
    font-size: 1rem;
    color: var(--ff-text-secondary);
    margin: 0 auto 32px;
    max-width: 480px;
    line-height: 1.7;
}

.ff-estimated-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ff-background);
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--ff-text-secondary);
    margin-bottom: 32px;
}

.ff-section-view {
    background: var(--ff-surface);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow-md);
    padding: 40px;
}

.ff-progress-bar {
    height: 6px;
    background: var(--ff-border);
    border-radius: 9999px;
    margin-bottom: 32px;
    overflow: hidden;
}

.ff-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ff-primary), var(--ff-primary-light));
    transition: width 0.3s ease;
    border-radius: 9999px;
}

.ff-section-header {
    margin-bottom: 32px;
}

.ff-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ff-text-primary);
    margin: 0 0 8px;
}

.ff-section-description {
    font-size: 1.125rem;
    color: var(--ff-text-secondary);
    margin: 0;
}

.ff-questions-container {
    margin-bottom: 32px;
}

.ff-question {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--ff-border);
}

.ff-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ff-question-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ff-text-primary);
    margin-bottom: 12px;
    display: block;
}

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

.ff-question-help {
    font-size: 0.875rem;
    color: var(--ff-text-secondary);
    margin-bottom: 16px;
}

.ff-input-text,
.ff-input-textarea,
.ff-input-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--ff-border);
    border-radius: var(--ff-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

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

.ff-radio-group,
.ff-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ff-radio-card,
.ff-checkbox-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--ff-border);
    border-radius: var(--ff-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--ff-surface);
}

.ff-radio-card:hover,
.ff-checkbox-card:hover {
    border-color: var(--ff-primary);
    background: var(--ff-background);
}

.ff-radio-card.selected,
.ff-checkbox-card.selected {
    border-color: var(--ff-primary);
    background: rgba(37, 99, 235, 0.05);
}

.ff-radio-card input,
.ff-checkbox-card input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.ff-rating-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ff-rating-btn {
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ff-border);
    border-radius: var(--ff-radius);
    background: var(--ff-surface);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ff-rating-btn:hover {
    border-color: var(--ff-primary);
    background: var(--ff-background);
}

.ff-rating-btn.selected {
    background: var(--ff-primary);
    color: white;
    border-color: var(--ff-primary);
}

.ff-section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--ff-border);
}

.ff-save-status {
    flex: 1;
    text-align: center;
}

.ff-save-indicator {
    font-size: 0.875rem;
    color: var(--ff-success);
}

.ff-complete-screen {
    background: var(--ff-surface);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow-md);
    padding: 60px 40px;
    text-align: center;
}

.ff-success-icon {
    margin: 0 auto 24px;
    color: var(--ff-success);
}

.ff-complete-screen h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ff-text-primary);
    margin: 0 0 16px;
}

.ff-thank-you-text {
    font-size: 1.125rem;
    color: var(--ff-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.ff-submission-meta {
    font-size: 0.875rem;
    color: var(--ff-text-secondary);
}

.ff-portal-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--ff-text-secondary);
}

@media (max-width: 768px) {
    .ff-portal-container {
        padding: 20px;
    }
    
    .ff-auth-required,
    .ff-no-campaign,
    .ff-campaign-intro,
    .ff-section-view,
    .ff-complete-screen {
        padding: 32px 24px;
    }
    
    .ff-campaign-title {
        font-size: 2rem;
    }
    
    .ff-section-title {
        font-size: 1.5rem;
    }
    
    .ff-auth-actions {
        flex-direction: column;
    }
    
    .ff-auth-actions .ff-btn {
        width: 100%;
    }
    
    .ff-section-nav {
        flex-wrap: wrap;
    }
    
    .ff-save-status {
        order: -1;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ff-rating-group {
        justify-content: space-between;
    }
    
    .ff-rating-btn {
        min-width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

/* ── Player Vote ── */
.ff-pv-wrapper {
    margin: -8px -4px 0;
}

.ff-pv-hero {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 16px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.ff-pv-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(234,179,8,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.ff-pv-trophy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b, #eab308);
    border-radius: 50%;
    color: #78350f;
    margin-bottom: 10px;
    box-shadow: 0 0 24px rgba(234,179,8,0.35);
}

.ff-pv-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Grid */
.ff-player-vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
}

/* Card */
.ff-player-vote-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ff-pv-card-inner {
    background: var(--ff-surface);
    border: 2px solid var(--ff-border);
    border-radius: 16px;
    padding: 20px 12px 16px;
    text-align: center;
    position: relative;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.ff-pv-card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(37,99,235,0.04) 100%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.ff-player-vote-card:hover .ff-pv-card-inner {
    border-color: #93c5fd;
    box-shadow: 0 8px 25px -5px rgba(37,99,235,0.12), 0 0 0 1px rgba(37,99,235,0.05);
    transform: translateY(-4px);
}

.ff-player-vote-card:hover .ff-pv-card-inner::before {
    opacity: 1;
}

/* Selected state */
.ff-player-vote-card.selected .ff-pv-card-inner {
    border-color: #2563eb;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.18), 0 8px 25px -5px rgba(37,99,235,0.18);
    transform: translateY(-4px);
}

/* Image wrapper */
.ff-pv-img-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
}

.ff-pv-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    border: 3px solid #e2e8f0;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.ff-player-vote-card:hover .ff-pv-img {
    border-color: #93c5fd;
}

.ff-player-vote-card.selected .ff-pv-img {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}

.ff-pv-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.25) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.ff-player-vote-card.selected .ff-pv-glow {
    opacity: 1;
}

.ff-pv-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ff-player-vote-card:hover .ff-pv-img img {
    transform: scale(1.06);
}

.ff-pv-placeholder {
    font-size: 28px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1px;
}

/* Squad number display (when images disabled) */
.ff-pv-squad-number {
    font-size: 32px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -1px;
    line-height: 1;
}

.ff-player-vote-card:hover .ff-pv-squad-number {
    color: #2563eb;
}

.ff-player-vote-card.selected .ff-pv-squad-number {
    color: #2563eb;
}

/* No-images mode: tighter cards */
.ff-pv-no-images .ff-pv-img-wrap,
.ff-pv-no-images .ff-pv-img {
    width: 80px;
    height: 80px;
}

.ff-pv-no-images .ff-pv-img {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 3px solid #cbd5e1;
}

.ff-pv-no-images .ff-player-vote-card:hover .ff-pv-img {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.ff-pv-no-images .ff-player-vote-card.selected .ff-pv-img {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

/* Squad number badge */
.ff-pv-number {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.25s;
}

.ff-player-vote-card.selected .ff-pv-number {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

/* Info */
.ff-pv-info {
    margin-bottom: 4px;
}

.ff-pv-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--ff-text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}

.ff-pv-position {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
}

.ff-player-vote-card.selected .ff-pv-position {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Vote badge */
.ff-pv-vote-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.ff-player-vote-card.selected .ff-pv-vote-badge {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .ff-player-vote-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    .ff-pv-img-wrap,
    .ff-pv-img {
        width: 76px;
        height: 76px;
    }
    .ff-pv-card-inner { padding: 16px 8px 12px; }
    .ff-pv-name { font-size: 13px; }
    .ff-pv-number { width: 26px; height: 26px; font-size: 11px; }
}

@media (max-width: 480px) {
    .ff-player-vote-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .ff-pv-img-wrap,
    .ff-pv-img {
        width: 64px;
        height: 64px;
    }
    .ff-pv-hero { padding: 16px 12px 12px; margin-bottom: 16px; }
    .ff-pv-trophy { width: 44px; height: 44px; }
    .ff-pv-trophy svg { width: 24px; height: 24px; }
}

/* ── Thank You / Complete Screen ── */
.ff-complete-screen {
    text-align: center;
    padding: 48px 24px 40px;
    max-width: 560px;
    margin: 0 auto;
    animation: ffFadeUp 0.5s ease both;
}

@keyframes ffFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.ff-ty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #16a34a;
    margin-bottom: 20px;
    box-shadow: 0 0 0 8px rgba(22,163,74,0.08);
}

.ff-ty-heading {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.ff-ty-text {
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    margin: 0 auto 24px;
    max-width: 440px;
}

.ff-ty-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    margin-bottom: 8px;
}

.ff-ty-badge svg {
    flex-shrink: 0;
}

/* Upsell card */
.ff-ty-upsell {
    margin-top: 32px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 16px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 16px rgba(217,119,6,0.08);
    animation: ffFadeUp 0.6s 0.15s ease both;
}

.ff-ty-upsell-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.ff-ty-upsell-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ff-ty-upsell-body {
    padding: 20px 24px 24px;
}

.ff-ty-upsell-title {
    font-size: 18px;
    font-weight: 800;
    color: #92400e;
    margin: 0 0 8px;
}

.ff-ty-upsell-text {
    font-size: 14px;
    line-height: 1.6;
    color: #78350f;
    margin: 0 0 16px;
}

.ff-ty-upsell-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(217,119,6,0.25);
}

.ff-ty-upsell-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217,119,6,0.35);
}

@media (max-width: 600px) {
    .ff-complete-screen { padding: 32px 16px; }
    .ff-ty-heading { font-size: 22px; }
    .ff-ty-icon { width: 72px; height: 72px; }
    .ff-ty-icon svg { width: 48px; height: 48px; }
    .ff-ty-upsell-img { height: 140px; }
    .ff-ty-upsell-body { padding: 16px 18px 20px; }
}
