/**
 * YouTube Link Gallery - Style Sheet (Versão 4.1)
 * Design aprimorado com melhor responsividade
 */

:root {
    --purple-glow: #a855f7;
    --purple-vibrant: #9333ea;
    --purple-deep: #581c87;
    --text-heading: #ffffff;
    --text-primary: #f8f7ff;
    --border-glass: rgba(168, 85, 247, 0.2);
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-glass: rgba(26, 15, 46, 0.8);
    --border-radius: 16px;
}

/* =============================================================================
   COMPONENTES DO FORMULÁRIO (ENVIO)
   ============================================================================= */

.converter-card {
    padding: 30px;
    margin: 20px 0;
}

#ylg-progress-container {
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 2px dashed var(--border-glass);
}

#ylg-progress-container h3 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-heading);
    font-weight: 600;
}

#ylg-progress-container > p {
    color: var(--text-primary);
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Barra de Progresso */
#ylg-progress-bar {
    width: 100%;
    height: 16px;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--purple-glow);
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
}

#ylg-progress-bar::-webkit-progress-bar {
    background-color: rgba(255, 255, 255, 0.05);
}

#ylg-progress-bar::-webkit-progress-value {
    background: linear-gradient(90deg, var(--purple-deep), var(--purple-vibrant), var(--purple-glow));
    box-shadow: 0 0 15px var(--purple-glow);
    transition: width 0.5s ease;
}

#ylg-progress-bar::-moz-progress-bar {
    background: linear-gradient(90deg, var(--purple-deep), var(--purple-vibrant), var(--purple-glow));
    box-shadow: 0 0 15px var(--purple-glow);
    transition: width 0.5s ease;
}

.progress-label {
    text-align: right;
    font-weight: 600;
    margin-top: 10px;
    color: var(--purple-glow);
    font-size: 0.95rem;
}

/* Mensagens de Status */
#ylg-status-message {
    margin-top: 20px;
}

#ylg-status-message p {
    margin: 0;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

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

.status-error { 
    color: var(--error-color); 
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-success { 
    color: var(--success-color); 
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-loading { 
    color: var(--text-primary); 
    background: rgba(147, 51, 234, 0.2);
    border: 1px solid var(--purple-glow);
}

/* Formulário de Submissão */
#ylg-submission-form {
    padding-top: 0;
}

#ylg-submission-form h3,
.form-title {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-heading);
    font-weight: 600;
}

#ylg-submission-form input[type="url"],
#ylg-video-url {
    display: block;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-glass);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text-heading);
    font-size: 1rem;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#ylg-submission-form input[type="url"]:focus,
#ylg-video-url:focus {
    outline: none;
    border-color: var(--purple-glow);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

#ylg-submission-form button,
#ylg-submit-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--purple-vibrant), var(--purple-glow));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

#ylg-submission-form button:hover:not(:disabled),
#ylg-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

#ylg-submission-form button:active:not(:disabled),
#ylg-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

#ylg-submission-form button:disabled,
#ylg-submit-button:disabled {
    background: #4a3f6a !important;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

/* =============================================================================
   RANKING SECTION
   ============================================================================= */

.ranking-section {
    margin: 60px 0;
}

.ranking-section h2 {
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    border-left: 5px solid var(--purple-glow);
    padding-left: 20px;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

#ylg-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    background: rgba(40, 25, 60, 0.7);
    border-left: 5px solid var(--purple-glow);
    transition: all 0.3s ease;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.rank-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.3);
    border-left-width: 8px;
}

.rank-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--purple-glow);
    margin-right: 25px;
    text-shadow: 0 0 15px var(--purple-vibrant);
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.rank-details {
    flex-grow: 1;
    min-width: 0;
}

.rank-details h4 {
    font-size: 1.15rem;
    margin: 0 0 5px 0;
    color: var(--text-heading);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-details p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
    color: var(--text-primary);
}

.rank-thumbnail {
    width: 100px;
    height: auto;
    border-radius: 8px;
    margin-left: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.no-ranking-data {
    text-align: center;
    padding: 40px;
    color: var(--text-primary);
    opacity: 0.7;
    font-size: 1.1rem;
}

/* =============================================================================
   GALERIA E VÍDEOS
   ============================================================================= */

.gallery-section {
    margin: 60px 0;
}

.gallery-title,
.gallery-section h2 {
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    border-left: 5px solid var(--purple-glow);
    padding-left: 20px;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

#ylg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.ylg-gallery-item {
    position: relative;
    min-height: 200px;
    padding: 0;
    overflow: hidden;
    background: rgba(26, 15, 46, 0.8);
    transition: all 0.3s ease;
    border-radius: 12px;
    border: 2px solid var(--border-glass);
}

.ylg-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
    border-color: var(--purple-glow);
}

.ylg-player-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    background: #000;
}

.ylg-player-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ylg-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ylg-gallery-item:hover img {
    transform: scale(1.05);
}

.video-title {
    display: block;
    padding: 15px;
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-gallery-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-primary);
    opacity: 0.7;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* =============================================================================
   PAGINAÇÃO
   ============================================================================= */

.ylg-pagination {
    margin: 40px 0;
    text-align: center;
}

.ylg-pagination-top {
    margin-bottom: 30px;
}

.ylg-pagination-bottom {
    margin-top: 40px;
}

.ylg-pagination ul {
    list-style: none;
    display: inline-flex;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ylg-pagination li {
    margin: 0;
}

.ylg-pagination a,
.ylg-pagination span {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-glass);
    font-weight: 500;
}

.ylg-pagination li:last-child a,
.ylg-pagination li:last-child span {
    border-right: none;
}

.ylg-pagination a:hover {
    background-color: rgba(147, 51, 234, 0.3);
    color: var(--purple-glow);
}

.ylg-pagination .current {
    background: var(--purple-vibrant);
    color: var(--text-heading);
    font-weight: 700;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.ylg-pagination .prev,
.ylg-pagination .next {
    font-weight: 600;
}

/* =============================================================================
   RESPONSIVIDADE
   ============================================================================= */

@media (max-width: 768px) {
    #ylg-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .rank-item {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .rank-number {
        font-size: 2rem;
        width: 40px;
        margin-right: 15px;
    }
    
    .rank-thumbnail {
        width: 80px;
        margin-left: 15px;
    }
    
    .ylg-pagination a,
    .ylg-pagination span {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .converter-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    #ylg-gallery {
        grid-template-columns: 1fr;
    }
    
    .rank-thumbnail {
        width: 100%;
        margin: 15px 0 0 0;
        order: 3;
    }
    
    .rank-details {
        order: 2;
    }
    
    .rank-number {
        order: 1;
    }
    
    .ylg-pagination a,
    .ylg-pagination span {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}