/* CSS para o novo layout da página de sorteados */

/* Remove padding do sorteio-finalizado */
.sorteio-finalizado {
    padding: 0 !important;
}

body.light .sorteio-finalizado,
.light .sorteio-finalizado {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

/* Background do body - mesmo da index */
body {
    background-color: rgb(22, 28, 36) !important;
}

body.light {
    background-color: #f9f9f9 !important;
}

/* Container principal */
.sorteio-container {
    max-width: 600px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 1rem !important;
    padding-top: 0 !important;
    background: #212B36 !important;
    overflow: hidden !important;
}

body.light .sorteio-container {
    background: #ffffff !important;
}

.light .sorteio-container {
    background: #ffffff !important;
}

/* Carousel Container */
.carousel-container-sorteada {
    width: calc(100% + 2rem) !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.carousel-wrapper-sorteada {
    border-radius: 0 !important;
    border: none !important;
    height: 320px !important;
    position: relative !important;
    overflow: hidden !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    touch-action: pan-y pinch-zoom !important;
    margin-bottom: 0 !important;
}

/* Imagem/Vídeo */
.carousel-image-sorteada,
.carousel-video-sorteada {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Badge "Sorteio Finalizado" - posicionada acima do título */
.carousel-badge-sorteada {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    bottom: auto !important;
    display: inline-block !important;
    background: rgba(244, 67, 54, 0.85) !important;
    border: 1.5px solid #f44336 !important;
    color: #ffffff !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: default !important;
    pointer-events: none !important;
    width: fit-content !important;
    z-index: 15 !important;
}

body.dark .carousel-badge-sorteada,
body.index-page.dark .carousel-badge-sorteada,
.dark .carousel-badge-sorteada {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .carousel-badge-sorteada {
        top: 8px !important;
        left: 8px !important;
        padding: 4px 10px !important;
        font-size: 8px !important;
    }
    
    .sorteio-finalizado .rifinha__header {
        align-items: center !important;
        justify-content: center !important;
    }
    
    .sorteio-finalizado .rifinha__header .rifinha__title {
        text-align: center !important;
        font-size: 0.95rem !important;
    }
    
    .sorteio-finalizado .rifinha__premio-value {
        font-size: 0.8rem !important;
        text-align: right !important;
    }
    
    .sorteio-finalizado .rifinha__winner-name {
        font-size: 0.8rem !important;
        text-align: right !important;
        justify-content: flex-end !important;
    }
}

/* Título sobre o carousel */
.carousel-title-sorteada {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
    color: #fff;
    padding: 1rem;
    z-index: 10;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
}


/* Botão Ver Meus Números - Replicado da rifa-v2-dark.css */
.btn-view-sorteada {
    background: #080a0c !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    height: 32px !important;
    width: calc(100% + 2rem) !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    cursor: pointer !important;
    transition: background-color 0.3s !important;
    padding: 0 !important;
}

.btn-view-sorteada i,
.btn-view-sorteada svg {
    width: 1rem !important;
    height: 1rem !important;
}

.btn-view-sorteada:hover {
    background: #0f1419 !important;
}

body.dark .btn-view-sorteada:hover,
body.index-page.dark .btn-view-sorteada:hover,
.dark .btn-view-sorteada:hover {
    color: #fbbf24 !important;
}

body.dark .btn-view-sorteada:hover svg,
body.index-page.dark .btn-view-sorteada:hover svg,
.dark .btn-view-sorteada:hover svg,
body.dark .btn-view-sorteada:hover i,
body.index-page.dark .btn-view-sorteada:hover i,
.dark .btn-view-sorteada:hover i {
    color: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

body.light .btn-view-sorteada {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
}

body.light .btn-view-sorteada svg,
body.light .btn-view-sorteada i {
    color: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

body.light .btn-view-sorteada:hover {
    background: #e5e7eb !important;
}

/* Progress Bar - Verde como na view antiga de sorteados */
.progress-container-sorteada {
    width: calc(100% + 2rem) !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.progress-bar-sorteada {
    height: 20px !important;
    width: 100% !important;
    font-size: 12px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.progress-fill-sorteada {
    display: none !important;
}

.progress-text-sorteada {
    color: white !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* Description Toggle Section - Replicado da rifa-v2-dark.css */
.description-toggle-section {
    margin: 1.5rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light .description-toggle-section {
    border-top: 1px solid #e5e7eb;
}

.description-toggle-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem;
    width: 100%;
    border-radius: 0.375rem;
    transition: all 0.3s;
}

.description-toggle-btn:hover {
    background: #0f1419;
    color: #fff;
}

body.light .description-toggle-btn {
    color: #111827;
}

body.light .description-toggle-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.description-toggle-btn svg {
    width: 0.9rem;
    height: 0.9rem;
}

.description-toggle-btn .toggle-icon {
    transition: transform 0.3s;
}

.description-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.description-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
    margin-top: 1rem !important;
}

.description-content.active {
    max-height: 400px !important;
    overflow-y: auto !important;
}

.description-text {
    text-align: left;
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 0 1rem;
}

body.light .description-text {
    color: #374151;
}

.description-text p {
    margin-bottom: 1rem;
}

/* Custom scrollbar para description */
.description-content::-webkit-scrollbar {
    width: 8px;
}

.description-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.description-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.description-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

body.light .description-content::-webkit-scrollbar-track,
.light .description-content::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.05);
}

body.light .description-content::-webkit-scrollbar-thumb,
.light .description-content::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.45);
}

body.light .description-content::-webkit-scrollbar-thumb:hover,
.light .description-content::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.6);
}

/* Buyers Section - Replicado da rifa-v2-dark.css */
.buyers-section {
    margin-bottom: 2.5rem;
}

.buyers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0;
}

.buyer-card {
    background: #374151;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    padding-left: 2.5rem;
    border-left: 4px solid #6b7280;
    transition: background-color 0.3s;
    position: relative;
    overflow: visible;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

body.light .buyer-card {
    background: #f3f4f6;
    box-shadow: rgba(145, 158, 171, .7) 0 0 2px 0, rgba(145, 158, 171, .2) 0 12px 24px -4px;
}

.light .buyer-card {
    background: #f9fafb;
    box-shadow: rgba(145, 158, 171, .7) 0 0 2px 0, rgba(145, 158, 171, .2) 0 12px 24px -4px;
}

body.light .buyer-card.first {
    border-left-color: #f59e0b !important;
}

.light .buyer-card.first {
    border-left-color: #f59e0b !important;
}

.buyer-card.first {
    border-left-color: #fbbf24;
}

.buyer-card.second {
    border-left-color: #d1d5db;
}

body.light .buyer-card.second,
.light .buyer-card.second {
    border-left-color: #777777 !important;
}

.buyer-card.third {
    border-left-color: #d97706;
}

body.light .buyer-card.third,
.light .buyer-card.third {
    border-left-color: #d97706 !important;
}

.buyer-card:not(.first):not(.second):not(.third) {
    border-left-color: #9CA3AF;
}

body.light .buyer-card:not(.first):not(.second):not(.third),
.light .buyer-card:not(.first):not(.second):not(.third) {
    border-left-color: #9CA3AF !important;
}

.buyer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.buyer-medal {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    line-height: 1;
}

.buyer-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.8rem;
    flex: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

}

body.light .buyer-name {
    color: #111827;
}

.buyer-stats {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.buyer-label {
    color: #9ca3af;
    font-size: 0.7rem;
}

body.light .buyer-label {
    color: #6b7280;
}

.buyer-count {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.buyer-card.first .buyer-count {
    color: #fbbf24;
}

body.light .buyer-card.first .buyer-count,
.light .buyer-card.first .buyer-count {
    color: #f59e0b !important;
}

.buyer-card.second .buyer-count {
    color: #d1d5db;
}

body.light .buyer-card.second .buyer-count,
.light .buyer-card.second .buyer-count {
    color: #777777 !important;
}

.buyer-card.third .buyer-count {
    color: #d97706;
}

.buyer-card:not(.first):not(.second):not(.third) .buyer-count {
    color: #9CA3AF;
}

.buyers-grid .buyer-card:nth-child(4),
.buyers-grid .buyer-card:nth-child(5) {
    border-left-color: #9CA3AF !important;
}

.buyers-grid .buyer-card:nth-child(4) .buyer-count,
.buyers-grid .buyer-card:nth-child(5) .buyer-count {
    color: #9CA3AF !important;
}

/* Informações do Sorteio e Ganhador - Layout Vertical */
.sorteio-info-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin-bottom: 3rem !important;
    margin-top: 1.5rem !important;
}

.sorteio-card {
    background: #374151 !important;
    border-radius: 0.5rem !important;
    padding: 0.875rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    width: 100% !important;
    border: none !important;
    overflow: visible !important;
}

body.light .sorteio-card {
    background: #ffffff !important;
    box-shadow: rgba(145, 158, 171, .7) 0 0 2px 0, rgba(145, 158, 171, .2) 0 12px 24px -4px !important;
}

.light .sorteio-card {
    background: #ffffff !important;
    box-shadow: rgba(145, 158, 171, .7) 0 0 2px 0, rgba(145, 158, 171, .2) 0 12px 24px -4px;
}

.sorteio-card__header {
    margin-bottom: 0.5rem !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.sorteio-card__title {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 !important;
}

body.light .sorteio-card__title {
    color: #111827 !important;
}

.light .sorteio-card__title {
    color: #111827 !important;
}

.sorteio-card__content {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0 !important;
}

.sorteio-info__item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    line-height: 1.2 !important;
}

.sorteio-info__label {
    color: #9ca3af !important;
    font-weight: 400 !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
}

body.light .sorteio-info__label {
    color: #6b7280 !important;
}

.light .sorteio-info__label {
    color: #6b7280 !important;
}

.sorteio-info__value {
    color: #fff !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    text-align: right !important;
    max-width: 60% !important;
}

body.light .sorteio-info__value {
    color: #111827 !important;
}

.light .sorteio-info__value {
    color: #111827 !important;
}

body.light .buyers-section h2,
.light .buyers-section h2 {
    color: #111827 !important;
}

.buyers-section .section-title-container h2 {
    font-size: 0.95rem !important;
}

/* Número sorteado em destaque - badge */
.sorteio-info__numero-destaque {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.22rem 0.55rem !important;
    border-radius: 0.6rem !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    width: auto !important;
    text-align: right !important;
}

body.light .sorteio-info__value.sorteio-info__numero-destaque,
.light .sorteio-info__value.sorteio-info__numero-destaque {
    color: inherit !important;
    background: inherit !important;
    border: inherit !important;
}

body.dark .sorteio-info__numero-destaque {
    color: inherit !important;
    background: inherit !important;
    border: inherit !important;
}

/* Títulos Premiados - Replicado da rifa-v2-dark.css */
.titles-section {
    margin-bottom: 2rem;
}

.titles-section .section-header {
    margin-bottom: 1rem;
}

.titles-section .section-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.titles-section .section-title-container h2 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

body.light .titles-section .section-title-container h2 {
    color: #111827;
}

.titles-section .section-title-container .count {
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.95rem;
}

.titles-container {
    display: flex;
    flex-direction: column;
}

.titles-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.titles-list li.badge {
    width: 100% !important;
    color: #fff;
    background: #374151;
    background-image: none;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 0;
    overflow: hidden;
    padding: 0.3rem;
    border-radius: 8px;
    margin: 0;
}

body.light .titles-list li.badge {
    color: #111827;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.titles-list .badge-group {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.titles-list .badge-group span {
    margin: 0;
    padding: 5px;
    color: #fff;
}

.titles-list .badge-group .awarded_number {
    height: 22px;
    line-height: 0;
    border-radius: 6px;
    cursor: default;
    align-items: center;
    white-space: nowrap;
    display: inline-flex;
    justify-content: center;
    padding: 0px 8px;
    font-size: 0.75rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 700;
    background-color: #6b7280;
    color: #fff;
    min-width: 15%;
    max-width: 30%;
}

.titles-list .badge-group .awarded_value {
    font-weight: bold;
    color: #ffffff;
}

/* Títulos já sorteados - fundo verde */
.titles-list .aw-blocked {
    background-color: rgb(25, 135, 84) !important;
}

.titles-list .aw-blocked span {
    color: #FFFFFF;
}

.titles-list .aw-blocked .awarded_number {
    background-color: #ffffff !important;
    color: #000000;
}

/* Nome "Sorteado" nos títulos */
.titles-list .winner-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
}

.titles-list .aw-blocked .winner-name {
    background: transparent !important;
    color: #fff !important;
    padding: 0 !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    height: auto !important;
}

.sorteio-finalizado .rifinha__premio-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.75rem !important;
    margin-top: 0.5rem !important;
}

.sorteio-finalizado .rifinha__card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.sorteio-finalizado .rifinha__content {
    padding: 0 1rem 1rem 1rem !important;
}

.sorteio-finalizado .rifinha__header {
    background: transparent !important;
    border: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sorteio-finalizado .rifinha__premio {
    width: 100% !important;
    padding: 0.85rem 0.9rem !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    min-height: 0 !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 0.75rem !important;
    background: #ffffff !important;
    box-shadow: rgba(145, 158, 171, .7) 0 0 2px 0, rgba(145, 158, 171, .2) 0 12px 24px -4px !important;
}


.sorteio-finalizado .rifinha__premio-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    width: 100% !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(145, 158, 171, 0.15) !important;
    margin-bottom: 0.25rem !important;
}

.sorteio-finalizado .rifinha__premio-title {
    font-size: 1rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

.sorteio-finalizado .rifinha__premio-trophy {
    font-size: 1.1rem !important;
    line-height: 1 !important;
}

.sorteio-finalizado .rifinha__premio-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.sorteio-finalizado .rifinha__premio-row:last-child {
    border-bottom: none !important;
}

.sorteio-finalizado .rifinha__premio-label {
    font-size: 0.85rem !important;
    opacity: 0.7 !important;
    font-weight: 500 !important;
}

.sorteio-finalizado .rifinha__premio-number-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.22rem 0.55rem !important;
    border-radius: 0.6rem !important;
    background: rgba(40, 167, 69, 0.14) !important;
    border: 1px solid rgba(40, 167, 69, 0.55) !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.sorteio-finalizado .rifinha__premio-value {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
}

.sorteio-finalizado .rifinha__premio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    align-items: center;
    opacity: 0.92;
}

.sorteio-finalizado .rifinha__premio-meta-label {
    font-size: 0.72rem;
    opacity: 0.75;
}

.sorteio-finalizado .rifinha__winner-name {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

.sorteio-finalizado .rifinha__winner-uf {
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 0.4rem !important;
    background: rgba(148, 163, 184, 0.12) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    display: inline-block !important;
    line-height: 1 !important;
    line-height: 1;
}


.sorteio-finalizado .rifinha__header .rifinha__title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
    text-align: center !important;
}

/* ========================================
   DARK MODE - Cards de Prêmios Sorteados
   ======================================== */

body.dark .sorteio-finalizado .rifinha__premio {
    background: #1f2937 !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
    box-shadow: rgba(0, 0, 0, .3) 0 0 2px 0, rgba(0, 0, 0, .2) 0 12px 24px -4px !important;
}

body.dark .sorteio-finalizado .rifinha__premio-header {
    border-bottom: 1px solid rgba(75, 85, 99, 0.3) !important;
}

body.dark .sorteio-finalizado .rifinha__premio-title {
    color: #f9fafb !important;
}

body.dark .sorteio-finalizado .rifinha__premio-row {
    border-bottom: 1px solid rgba(75, 85, 99, 0.2) !important;
}

body.dark .sorteio-finalizado .rifinha__premio-label {
    color: #d1d5db !important;
}

body.dark .sorteio-finalizado .rifinha__premio-value {
    color: #f9fafb !important;
}

body.dark .sorteio-finalizado .rifinha__winner-name {
    color: #f9fafb !important;
}

body.dark .sorteio-finalizado .rifinha__header .rifinha__title {
    color: #f9fafb !important;
}
