/* ============================================================
   Wedding Challenge — Sfida Fotografica
   ============================================================ */

/* Wrapper */
.wc-wrap {
    max-width: 960px;
    margin: 0 auto;
    font-family: inherit;
}

.wc-step-title {
    font-size: 1.3em;
    color: #5a4a42;
    margin: 0 0 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8ddd8;
}

/* ---- Challenge cards grid ---- */

/* ---- Azioni primarie ---- */

.wc-primary-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 28px;
}

.wc-actions-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b8a9a0;
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 10px 0;
}

.wc-actions-divider::before,
.wc-actions-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8ddd8;
}

.wc-primary-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 28px 16px !important;
    border-radius: 18px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.18s, box-shadow 0.18s !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
}

.wc-primary-btn span {
    font-size: 1em;
}

.wc-btn-icon {
    font-size: 2.6em !important;
    line-height: 1 !important;
    display: block !important;
}

.wc-scan-btn {
    background: #fff !important;
    color: #5a4a42 !important;
    border: 2px solid #e8ddd8 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

.wc-scan-btn:hover {
    border-color: #b8a9a0 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(184,169,160,0.2) !important;
}

.wc-scan-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.wc-random-primary-btn {
    background: #fff !important;
    color: #5a4a42 !important;
    border: 2px solid #e8ddd8 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

.wc-random-primary-btn:hover,
.wc-random-primary-btn:active {
    border-color: #b8a9a0 !important;
    background: #fdf8f5 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(184,169,160,0.2) !important;
}

/* ---- Separatore ---- */

.wc-or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
    color: #c0b0a8;
    font-size: 0.88em;
}

.wc-or-divider::before,
.wc-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8ddd8;
}

/* ---- Photo picker (challenge form) ---- */

.wc-photo-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 16px;
    background: #fafafa;
    border: 2px dashed #e8ddd8;
    border-radius: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.wc-photo-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 16px 20px !important;
    background: #b8a9a0 !important;
    color: #fff !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 1.05em !important;
    cursor: pointer !important;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s !important;
    box-shadow: 0 4px 14px rgba(184,169,160,0.4) !important;
    letter-spacing: 0.01em !important;
    box-sizing: border-box !important;
    text-transform: none !important;
}

.wc-photo-btn:hover {
    background: #a0908a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(184,169,160,0.5) !important;
}

.wc-photo-icon {
    font-size: 1.5em !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.wc-photo-or {
    font-size: 0.9em;
    color: #aaa;
}

.wc-gallery-link {
    color: #b8a9a0 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    font-weight: 600 !important;
}

.wc-gallery-link:hover {
    color: #8c7b74 !important;
}

.wc-file-preview {
    margin-bottom: 16px;
}

/* ---- Tasto visualizza elenco ---- */

.wc-list-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 28px 16px !important;
    background: #fff !important;
    color: #5a4a42 !important;
    border: 2px solid #e8ddd8 !important;
    border-radius: 18px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

.wc-list-btn:hover {
    border-color: #b8a9a0 !important;
    background: #fdf8f5 !important;
    box-shadow: 0 6px 20px rgba(184,169,160,0.2) !important;
}

/* ---- Scan loader ---- */

.wc-scan-loader {
    background: #fdf8f5;
    border: 1px solid #e8ddd8;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 14px;
    animation: wcFadeIn 0.2s ease;
}

.wc-scan-loader-inner {
    display: flex;
    align-items: center;
    gap: 18px;
}

.wc-scan-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e8ddd8;
    border-top-color: #b8a9a0;
    border-radius: 50%;
    flex-shrink: 0;
    animation: wcSpin 0.9s linear infinite;
}

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

.wc-scan-loader-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-scan-loader-title {
    font-size: 1em;
    font-weight: 600;
    color: #5a4a42;
}

.wc-scan-loader-sub {
    font-size: 0.85em;
    color: #b8a9a0;
    animation: wcPulse 1.8s ease-in-out infinite;
}

@keyframes wcPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.wc-scan-status {
    min-height: 1.4em;
    font-size: 0.92em;
    margin-bottom: 8px;
    padding: 0 4px;
}

.wc-scan-status-info  { color: #b8a9a0; }
.wc-scan-status-error { color: #c0392b; }
.wc-scan-status-ok    { color: #46b450; }

.wc-random-btn {
    background: #b8a9a0 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 24px !important;
    padding: 10px 22px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.18s, transform 0.15s !important;
    box-shadow: 0 3px 10px rgba(184,169,160,0.35) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.wc-random-btn:hover {
    background: #a0908a !important;
    transform: translateY(-2px) !important;
}

.wc-random-btn:active {
    transform: translateY(0) !important;
}

/* Mobile: 1 colonna */
.wc-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 500px) {
    .wc-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (min-width: 800px) {
    .wc-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1100px) {
    .wc-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.wc-card {
    background: #fff;
    border: 2px solid #e8ddd8;
    border-radius: 18px;
    padding: 32px 20px 26px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wc-card:hover {
    border-color: #b8a9a0;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.wc-card-selected {
    border-color: #b8a9a0 !important;
    background: #fdf8f5 !important;
    box-shadow: 0 6px 24px rgba(184, 169, 160, 0.3) !important;
    transform: translateY(-3px);
}

.wc-card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: #b8a9a0;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.8em;
    margin: 0 auto 18px;
}

.wc-card-selected .wc-card-number {
    background: #8c7b74;
}

.wc-card-title {
    display: block;
    font-size: 1.25em;
    font-weight: 600;
    color: #5a4a42;
    margin: 0 0 10px;
    line-height: 1.3;
}

.wc-card-desc {
    font-size: 1em;
    color: #999;
    margin: 0;
    line-height: 1.5;
}

/* ---- Form area ---- */

.wc-form-wrap {
    background: #fdf8f5;
    border: 1px solid #e8ddd8;
    border-radius: 12px;
    padding: 28px;
    margin-top: 8px;
    animation: wcFadeIn 0.25s ease;
}

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

.wc-selected-info {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8ddd8;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 22px;
    font-size: 0.93em;
    color: #5a4a42;
}

.wc-selected-texts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.wc-selected-desc {
    display: block;
    font-size: 0.9em;
    color: #999;
    line-height: 1.4;
    font-weight: normal;
}

.wc-change-btn {
    background: transparent !important;
    border: 1px solid #c0b0a8 !important;
    border-radius: 20px !important;
    padding: 4px 14px !important;
    font-size: 0.82em !important;
    color: #777 !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin-left: auto;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
    box-shadow: none !important;
    line-height: 1.6 !important;
}

.wc-change-btn:hover {
    background: #b8a9a0 !important;
    color: #fff !important;
    border-color: #b8a9a0 !important;
}

/* File preview */
.wc-file-preview {
    margin-top: 8px;
}

.wc-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0d8d2;
    border-radius: 6px;
    font-size: 0.88em;
}

.wc-file-item .wedding-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #5a4a42;
}

.wc-file-item .wedding-file-size {
    color: #aaa;
    font-size: 0.85em;
    white-space: nowrap;
}

.wc-file-item .wedding-file-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #c0392b;
    font-size: 1.1em;
    line-height: 1;
    padding: 0 2px;
}

/* ============================================================
   Challenge Gallery — [wedding_challenge_gallery]
   ============================================================ */

.wcg-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

/* Filter pills */
.wcg-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.wcg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 22px;
    background: #f5f0ed;
    color: #5a4a42;
    font-size: 0.84em;
    text-decoration: none !important;
    border: 1px solid #e8ddd8;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.wcg-filter-btn:hover {
    background: #e8ddd8;
    color: #5a4a42;
}

.wcg-filter-active {
    background: #b8a9a0 !important;
    color: #fff !important;
    border-color: #b8a9a0 !important;
}

.wcg-count {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.85em;
    font-weight: 700;
}

.wcg-filter-active .wcg-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Photo card wrapper — foto + info sotto */
.wcg-photo-wrap {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(90,74,66,0.10) !important;
}

.wcg-gallery-item {
    position: relative !important;
    overflow: hidden !important;
    aspect-ratio: 1 !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.wcg-gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.wcg-gallery-item:hover img {
    transform: scale(1.04) !important;
}

.wcg-photo-meta {
    padding: 8px 10px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

/* Caption badge inside gallery card */
.wcg-challenge-label {
    display: block !important;
    font-size: 0.70em !important;
    color: #b8a9a0 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.wcg-photo-guest {
    font-size: 0.88em !important;
    font-weight: 600 !important;
    color: #5a4a42 !important;
}

.wcg-photo-msg {
    font-size: 0.78em !important;
    color: #9e8e86 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.wcg-photo-score {
    display: inline-block !important;
    font-size: 0.80em !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 20px !important;
    margin-top: 4px !important;
    align-self: flex-start !important;
}

.wcg-score-ok  { background: #e8f5e9 !important; color: #2e7d32 !important; }
.wcg-score-low { background: #fff3e0 !important; color: #e65100 !important; }

.wcg-photo-reason {
    font-size: 0.75em !important;
    color: #9e8e86 !important;
    font-style: italic !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ---- Search box gallery ---- */

.wcg-search-wrap {
    margin: 16px 0 20px;
}

.wcg-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #b8a9a0;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 10px;
}

.wcg-clear-filter {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1.2em;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.wcg-clear-filter:hover { opacity: 1; }

.wcg-search-box {
    position: relative;
}

.wcg-search-input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #e8ddd8 !important;
    border-radius: 12px !important;
    font-size: 1em !important;
    font-family: inherit !important;
    color: #5a4a42 !important;
    background: #fff !important;
    box-sizing: border-box !important;
    transition: border-color 0.18s !important;
}

.wcg-search-input:focus {
    outline: none !important;
    border-color: #b8a9a0 !important;
}

.wcg-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e8ddd8;
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.wcg-search-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    color: #5a4a42 !important;
    text-decoration: none !important;
    font-size: 0.95em !important;
    transition: background 0.15s !important;
    border-bottom: 1px solid #f5f0ee !important;
}

.wcg-search-item:last-child { border-bottom: none !important; }

.wcg-search-item:hover {
    background: #fdf8f5 !important;
    color: #5a4a42 !important;
}

/* ---- Tab switcher gallery ---- */

.wcg-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 0;
    border-bottom: 2px solid #e8ddd8;
}

.wcg-tab {
    padding: 10px 22px;
    font-size: 0.95em;
    font-weight: 600;
    color: #b8a9a0;
    text-decoration: none !important;
    border-radius: 8px 8px 0 0;
    border: 2px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    transition: color 0.18s, background 0.18s;
}

.wcg-tab:hover {
    color: #5a4a42;
    background: #fdf8f5;
}

.wcg-tab-active {
    color: #5a4a42 !important;
    background: #fff !important;
    border-color: #e8ddd8 !important;
    border-bottom-color: #fff !important;
}

/* ---- Toggle risultati gallery ---- */

.wcg-toggle-wrap {
    text-align: center;
    margin: 16px 0 24px;
}

.wcg-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 14px 32px !important;
    background: #b8a9a0 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 24px !important;
    font-size: 1.05em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s !important;
    box-shadow: 0 4px 14px rgba(184,169,160,0.4) !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
}

.wcg-toggle-btn:hover {
    background: #a0908a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(184,169,160,0.45) !important;
}

/* ============================================================
   Challenge Random — [wedding_challenge_random]
   ============================================================ */

.wcr-wrap {
    max-width: 700px;
    margin: 0 auto;
}

.wcr-card {
    background: #fff;
    border: 2px solid #e8ddd8;
    border-radius: 20px;
    padding: 40px 30px 32px;
    text-align: center;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(184, 169, 160, 0.15);
}

.wcr-card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: #b8a9a0;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.8em;
    margin: 0 auto 18px;
}

.wcr-card-title {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: #5a4a42;
    margin-bottom: 10px;
    line-height: 1.25;
}

.wcr-card-desc {
    font-size: 1.05em;
    color: #888;
    margin: 0 0 24px;
    line-height: 1.5;
}

.wcr-reroll-btn {
    margin-top: 4px;
}

@media (max-width: 500px) {
    .wcr-card {
        padding: 28px 18px 24px;
    }
    .wcr-card-title {
        font-size: 1.25em;
    }
}

/* ============================================================
   Admin — Sfide Fotografiche
   ============================================================ */

.wca-add-form {
    background: #f8f7f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px 20px 20px;
    margin-bottom: 20px;
    max-width: 720px;
}

.wca-add-form h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

/* ============================================================
   wc-form-wrap — testi grandi e centrati, mobile-first
   ============================================================ */

/* Titolo step */
.wc-form-wrap .wc-step-title {
    font-size: 2em !important;
    text-align: center !important;
    margin-bottom: 22px !important;
}

/* Box sfida selezionata */
.wc-selected-info {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px 18px !important;
    gap: 14px !important;
    font-size: 1.15em !important;
}

.wc-selected-texts {
    align-items: center !important;
}

.wc-selected-desc {
    font-size: 1em !important;
    text-align: center !important;
}

.wc-change-btn {
    margin-left: 0 !important;
    padding: 8px 22px !important;
    font-size: 1em !important;
}

/* Labels */
.wc-form-wrap .wedding-field label {
    display: block !important;
    font-size: 1.35em !important;
    text-align: center !important;
    margin-bottom: 10px !important;
}

/* Input testo e textarea */
.wc-form-wrap .wedding-field input[type="text"],
.wc-form-wrap .wedding-field textarea {
    font-size: 1.25em !important;
    padding: 16px 18px !important;
    border-radius: 14px !important;
    text-align: center !important;
}

/* Dropzone */
.wc-form-wrap .wedding-dropzone {
    padding: 44px 24px !important;
    border-radius: 18px !important;
}

.wc-form-wrap .wedding-dropzone-label {
    font-size: 1.3em !important;
    gap: 10px !important;
}

.wc-form-wrap .wedding-icon {
    font-size: 64px !important;
    margin-bottom: 6px !important;
}

.wc-form-wrap .wedding-dropzone-label small {
    font-size: 0.8em !important;
    margin-top: 6px !important;
}

/* Pulsante invia */
.wc-form-wrap .wedding-btn {
    font-size: 1.4em !important;
    padding: 20px 24px !important;
    border-radius: 16px !important;
    letter-spacing: 0.03em !important;
}

/* Margini form fields più respirati su mobile */
.wc-form-wrap .wedding-field {
    margin-bottom: 26px !important;
}

/* Status messages */
.wc-form-wrap .wedding-status {
    font-size: 1.1em !important;
    text-align: center !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
}
