/**
 * Simplicio Composições - Custom Styles
 * =====================================
 *
 * This file contains custom styles that complement Tailwind CSS.
 * Most styling is done with Tailwind utility classes in the HTML.
 */

/* ======================= */
/* CSS CUSTOM PROPERTIES   */
/* ======================= */
:root {
    --color-primary-50: #f8fafc;
    --color-primary-100: #f1f5f9;
    --color-primary-200: #e2e8f0;
    --color-primary-300: #cbd5e1;
    --color-primary-400: #94a3b8;
    --color-primary-500: #64748b;
    --color-primary-600: #475569;
    --color-primary-700: #334155;
    --color-primary-800: #1e293b;
    --color-primary-900: #0f172a;
    --color-primary-950: #020617;

    --color-accent-400: #fbbf24;
    --color-accent-500: #f59e0b;
    --color-accent-600: #d97706;

    --color-success: #10b981;
    --color-warning: #eab308;
    --color-info: #3b82f6;

    --transition-base: 0.3s ease;
    --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* ======================= */
/* BASE STYLES             */
/* ======================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--color-accent-500);
    color: var(--color-primary-900);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary-900);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-500);
}

/* ======================= */
/* TYPOGRAPHY              */
/* ======================= */
.font-heading {
    font-family: 'Montserrat', 'Inter', sans-serif;
}

/* ======================= */
/* ANIMATIONS              */
/* ======================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease forwards;
}

.animate-modal-in {
    animation: modalIn 0.3s ease forwards;
}

/* Staggered animation delays for cards */
.song-card:nth-child(1) { animation-delay: 0ms; }
.song-card:nth-child(2) { animation-delay: 50ms; }
.song-card:nth-child(3) { animation-delay: 100ms; }
.song-card:nth-child(4) { animation-delay: 150ms; }
.song-card:nth-child(5) { animation-delay: 200ms; }
.song-card:nth-child(6) { animation-delay: 250ms; }
.song-card:nth-child(7) { animation-delay: 300ms; }
.song-card:nth-child(8) { animation-delay: 350ms; }
.song-card:nth-child(9) { animation-delay: 400ms; }

/* ======================= */
/* SONG CARDS              */
/* ======================= */

/* Grid View */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .songs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .songs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* List View */
.songs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Song Card Base */
.song-card {
    background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-800) 50%, rgba(30, 41, 59, 0.8));
    border: 1px solid var(--color-primary-700);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    animation: slideUp 0.4s ease backwards;
    position: relative;
    overflow: hidden;
}

.song-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent-500), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.song-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent-500);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.song-card:hover::before {
    opacity: 1;
}

/* Song Card - List View Variant */
.songs-list .song-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

@media (min-width: 768px) {
    .songs-list .song-card {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: center;
    }
}

.songs-list .song-card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.songs-list .song-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.songs-list .song-card .card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-primary-400);
}

/* Song Card Content */
.song-card .card-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: white;
    transition: color var(--transition-base);
}

.song-card:hover .card-title {
    color: var(--color-accent-500);
}

.song-card .card-genre {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-primary-400);
    margin-bottom: 1rem;
}

.song-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.song-card .tag {
    background: var(--color-primary-700);
    color: var(--color-primary-300);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.song-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-primary-700);
}

.song-card .play-hint {
    font-size: 0.875rem;
    color: var(--color-primary-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-base);
}

.song-card:hover .play-hint {
    color: var(--color-accent-500);
}

/* ======================= */
/* STATUS BADGES           */
/* ======================= */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.status-badge.disponivel {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.reservada {
    background-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-badge.gravada {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ======================= */
/* VIEW TOGGLE             */
/* ======================= */
.view-toggle {
    color: var(--color-primary-500);
    transition: all var(--transition-base);
}

.view-toggle:hover {
    color: var(--color-primary-300);
}

.view-toggle.active {
    background-color: var(--color-accent-500);
    color: var(--color-primary-900);
}

/* ======================= */
/* FILTER TAGS             */
/* ======================= */
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-accent-500);
    color: var(--color-primary-900);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem;
    border-radius: 9999px;
    transition: all var(--transition-base);
}

.filter-tag:hover {
    background: var(--color-accent-600);
}

.filter-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transition: background var(--transition-base);
}

.filter-tag button:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* ======================= */
/* MODAL                   */
/* ======================= */
.modal-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Lyrics Container */
.lyrics-container {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
}

.lyrics-container::-webkit-scrollbar {
    width: 6px;
}

.lyrics-container::-webkit-scrollbar-thumb {
    background: var(--color-primary-600);
    border-radius: 3px;
}

/* ======================= */
/* AUDIO PLAYER            */
/* ======================= */
.audio-player {
    width: 100%;
    height: 40px;
    outline: none;
}

/* Style audio player for webkit browsers */
audio::-webkit-media-controls-panel {
    background: var(--color-primary-700);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: var(--color-primary-300);
}

/* Audio Version Buttons */
.audio-version-btn {
    background: var(--color-primary-700);
    border: 1px solid var(--color-primary-600);
    color: var(--color-primary-300);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.audio-version-btn:hover {
    background: var(--color-primary-600);
    border-color: var(--color-primary-500);
}

.audio-version-btn.active {
    background: var(--color-accent-500);
    border-color: var(--color-accent-500);
    color: var(--color-primary-900);
}

/* ======================= */
/* FLOATING WHATSAPP       */
/* ======================= */
#floatingWhatsApp {
    animation: pulse-glow 2s infinite;
}

/* Hide on scroll (will be controlled by JS) */
#floatingWhatsApp.hidden-scroll {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* ======================= */
/* RESPONSIVE UTILITIES    */
/* ======================= */
@media (max-width: 640px) {
    .song-card {
        padding: 1rem;
    }

    .modal-content {
        margin: 1rem;
        border-radius: 1rem;
    }

    .lyrics-container {
        max-height: 300px;
        font-size: 0.9rem;
    }
}

/* ======================= */
/* FOCUS STATES            */
/* ======================= */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-accent-500);
    outline-offset: 2px;
}

/* ======================= */
/* LOADING STATES          */
/* ======================= */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-primary-800) 25%,
        var(--color-primary-700) 50%,
        var(--color-primary-800) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ======================= */
/* PRINT STYLES            */
/* ======================= */
@media print {
    body {
        background: white;
        color: black;
    }

    header,
    footer,
    #floatingWhatsApp,
    .audio-player-container,
    .view-toggle,
    .filter-tag {
        display: none !important;
    }

    .song-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}
