/* ========================================
   Himnario Digital — Public Pages
   Modern Design System v2.0
   ======================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --green: #34d399;
    --red: #f87171;
    --bg-dark: #0f0e17;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.10);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- Hero Background ---- */
.hero-bg {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(167, 139, 250, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 60%),
        linear-gradient(180deg, #0f0e17 0%, #1a1830 50%, #0f0e17 100%);
    background-attachment: fixed;
}

.hero-overlay {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ---- Header ---- */
.hero-header {
    text-align: center;
    padding: 3rem 0 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #7fd6ff, #38bdf8);
    border-radius: 20px;
    color: white;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
    animation: float 3s ease-in-out infinite;
}
.hero-icon-img {
    overflow: hidden;
    padding: 0;
    background: none;
}
.hero-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ---- Main Content ---- */
.hero-main {
    animation: fadeInUp 0.8s ease-out 0.2s both;
    position: relative;
    z-index: 2;
}

/* ---- Cards ---- */
.info-card, .search-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
    position: relative;
}

.search-card {
    overflow: visible !important;
    position: relative;
    z-index: 10;
}

.info-card:hover, .search-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.info-card-header, .search-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--accent-light);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.info-card-body, .search-card-body {
    padding: 1.5rem;
}

.info-card-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.info-card-body p:last-child { margin-bottom: 0; }

/* ---- Tags ---- */
.tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ---- Feature Grid ---- */
.info-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.info-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
}

.info-feature:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.info-feature svg {
    color: var(--green);
    flex-shrink: 0;
}

/* ---- Links ---- */
.info-links {
    margin: 1.25rem 0;
}

.info-link-yt {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    color: #ff4444;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.info-link-yt:hover {
    background: rgba(255, 0, 0, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.2);
}

.info-contact {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
}

/* ---- Search Form ---- */
.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-form .form-select {
    flex: 1;
}

/* ---- Live Search ---- */
.live-search {
    position: relative;
    width: 100%;
}

.live-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.live-search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s;
}

.live-search-field {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.live-search-field::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.live-search-field:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.live-search-field:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 4px 20px rgba(99, 102, 241, 0.1);
}

.live-search-field:focus ~ .live-search-icon,
.live-search-input-wrap:focus-within .live-search-icon {
    color: var(--primary-light);
}

.live-search-spinner {
    position: absolute;
    right: 16px;
    color: var(--primary-light);
    animation: spin 0.8s linear infinite;
    display: flex;
    align-items: center;
    z-index: 2;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.live-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1740;
    border: 1.5px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.08);
    max-height: 360px;
    overflow-y: auto;
    z-index: 9999;
    animation: searchSlideDown 0.2s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-8px) scaleY(0.96); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.live-search-results::-webkit-scrollbar {
    width: 6px;
}

.live-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.live-search-results::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.1));
}

.live-search-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 2px 2px 0;
}

.live-search-num {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    min-width: 48px;
    text-align: center;
}

.live-search-info {
    flex: 1;
    min-width: 0;
}

.live-search-titulo {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-himnario {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.live-search-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

/* ---- Search Button ---- */
.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-search:active { transform: translateY(0); }

/* ---- Footer ---- */
.hero-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer-center {
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-light);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.footer-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.footer-dot::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    vertical-align: middle;
}

.footer-author p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-author strong {
    color: var(--text-secondary);
}

.footer-phones-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.footer-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.footer-phone:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.footer-phone svg {
    opacity: 0.6;
}

/* ---- Sync Status ---- */
#sync-status {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: none;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

#sync-status.sync-ok {
    display: block;
    background: rgba(52, 211, 153, 0.9);
}

#sync-status.sync-error {
    display: block;
    background: rgba(248, 113, 113, 0.9);
}

/* ---- Animations ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero-overlay { padding: 1rem 1rem 3rem; }
    .hero-title { font-size: 1.6rem; letter-spacing: 2px; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-icon { width: 60px; height: 60px; border-radius: 16px; }
    .hero-icon svg { width: 30px; height: 30px; }

    .search-form {
        flex-direction: column;
    }

    .btn-search { width: 100%; justify-content: center; }

    .info-features {
        grid-template-columns: 1fr;
    }

    .footer-details {
        flex-direction: column;
        gap: 0.25rem;
    }

    .footer-dot::before {
        display: none;
    }

    .footer-phones-row {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ---- Print Styles ---- */
@media print {
    .hero-bg { background: white !important; min-height: auto !important; overflow: visible !important; }
    .hero-overlay { max-width: 100%; padding: 1rem; }
    .hero-header, .hero-footer, .search-card, .info-links { display: none !important; }
    .info-card { background: white; border: 1px solid #ddd; }
    .info-card-body p { color: #333; }
    body { color: #111; background: white; }
}
