/*
Theme Name: Telugu Christian Lyrics
Description: Custom theme for Telugu Christian songs with favorites functionality
Version: 4.9
Author: Your Name
Text Domain: telugu-lyrics
*/

/* =============================================
   Global Styles & Variables
   ============================================= */
:root {
    --primary-color: #E91E63;
    --primary-light: #FF80AB;
    --primary-dark: #C2185B;
    --secondary-color: #4CAF50;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #888888;
    --bg-color: #fdf6f8;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --gray-dark: #757575;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.15);
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans Telugu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Removed padding-top for header */
    margin: 0;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

body::after {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================
   Layout & Structure
   ============================================= */
#page {
    max-width: 100%;
    margin: 0 auto;
    background-color: transparent;
    position: relative;
}

.content-area {
    padding: 0;
}

main#main {
    padding: 10px 0 20px;
}

/* =============================================
   NEW Standalone Search Bar Styles
   ============================================= */
.site-search-container {
    padding: 20px 20px;
    background-color: var(--bg-color);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px; /* Optional: constrain search bar width on large screens */
    margin: 0 auto;
}

.header-search .search-icon {
    position: absolute;
    left: 15px;
    color: var(--gray-dark);
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

#live-song-search {
    width: 100%;
    padding: 12px 20px 12px 45px; /* Adjusted padding */
    font-size: 16px;
    border: 1px solid var(--gray-medium);
    border-radius: 30px;
    outline: none;
    transition: var(--transition-normal);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
}

#live-song-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.4);
}

#live-song-search::placeholder {
    color: var(--text-lighter);
    opacity: 1;
}


/* =============================================
   Page Title Styles
   ============================================= */
.page-section-title {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-light);
}

.page-section-title h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================
   Banner Styles
   ============================================= */
.banner-container {
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 15px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-container img {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-height: 200px;
    object-fit: cover;
    width: 100%;
}


/* =============================================
   Song List & Items
   ============================================= */
.song-list-container {
    padding: 0 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.song-list-container.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.song-item {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    will-change: transform, box-shadow;
    min-height: 69px;
}

.song-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.song-item.has-favorite {
    background-color: #fff5f7;
    border-left: 3px solid var(--primary-color);
}

.song-icon {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.song-details {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.song-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-title a {
    color: var(--text-color);
    transition: var(--transition-fast);
}

.song-title a:hover {
    color: var(--primary-color);
}

.song-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.song-item-placeholder {
    height: 69px;
    background: var(--gray-light);
    border-radius: 12px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 1200px;
    animation: pulse 1.5s infinite;
}

/* =============================================
   Favorite Button Styles
   ============================================= */
.favorite-btn {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 36px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: var(--transition-fast);
    will-change: transform, box-shadow;
}

.favorite-btn i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition-fast);
    font-size: 24px;
}

.favorite-btn .far {
    color: var(--gray-medium);
}

.favorite-btn .fas {
    color: var(--primary-color);
    display: none;
}

.favorite-btn.is-favorite .far {
    display: none;
}

.favorite-btn.is-favorite .fas {
    display: block;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.favorite-btn.is-loading i {
    animation: pulse 1s infinite;
}

.favorite-btn-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
    z-index: 1;
}

.favorite-btn:hover .favorite-btn-tooltip {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   Favorites Page Styles
   ============================================= */
.favorites-wrapper {
    position: relative;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 15px;
}

.favorites-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.favorites-count-badge {
    background: var(--primary-color);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.favorites-empty-message {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-style: italic;
}

.favorites-login-message {
    text-align: center;
    padding: 30px;
}

.favorites-login-message a {
    color: var(--primary-color);
    font-weight: 500;
}

.favorites-login-message a:hover {
    text-decoration: underline;
}

/* =============================================
   Categories Page Styles - Telugu Letters Grid
   ============================================= */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
    padding: 0 15px 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 12px;
    padding: 15px 5px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    min-height: 80px;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
}

.category-item.has-songs {
    cursor: pointer;
}

.category-item.has-songs:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #E91E63, #FF9800);
    color: var(--white);
}

.category-item.no-songs {
    opacity: 0.5;
    background: var(--gray-light);
}

.category-letter {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0;
    font-family: "Noto Sans Telugu", "Segoe UI", sans-serif;
}

.song-count {
    display: none !important;
}

/* =============================================
   Icon Page Templates (About, Contact, Privacy)
   ============================================= */
.icon-page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-icon-header {
    text-align: center;
    margin: 20px 0 30px;
}

.page-icon-header i {
    font-size: 80px;
    color: #E91E63;
    background: rgba(233, 30, 99, 0.1);
    width: 140px;
    height: 140px;
    line-height: 140px;
    border-radius: 50%;
    display: inline-block;
}

.icon-page-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    text-align: center;
    padding: 25px 15px;
    border-radius: 12px;
    background: var(--gray-light);
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

/* Contact Form */
.contact-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition-fast);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.2);
    outline: none;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Privacy Points */
.privacy-points {
    margin-top: 30px;
}

.privacy-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: 12px;
    margin-bottom: 15px;
}

.privacy-card i {
    font-size: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 3px;
}

.privacy-card h3 {
    margin-bottom: 5px;
    color: var(--primary-dark);
}

/* =============================================
   Single Song Page Styles
   ============================================= */
.single-song .song-header {
    padding: 25px 20px 20px; /* Consistent padding */
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    text-align: center;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.single-song .song-title {
    font-size: 28px;
    color: #e91e63;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 5px; /* Reduced bottom margin */
}

.single-song .song-subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    margin: 0 0 15px; /* Margin below subtitle, above button */
}

.single-song .song-actions {
    display: flex;
    justify-content: center;
    margin: 0 auto 15px; /* Removed top margin, added bottom margin */
}

.single-song .action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    color: #e91e63;
    font-size: 24px;
    transition: all 0.3s ease;
}

.single-song .action-btn:hover {
    background: #e91e63;
    color: white;
    transform: scale(1.1);
}

.single-song .action-btn.active {
    background: #e91e63;
    color: white;
}

.single-song .song-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 0; /* Removed top margin from old layout */
    font-size: 14px;
    color: #888;
    flex-wrap: wrap;
}

.single-song .lyrics-container {
    background: white;
    padding: 30px 20px;
    margin: 0 auto;
    max-width: 800px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border-radius: 0 0 10px 10px;
}

.single-song .lyrics-content {
    font-size: 20px;
    line-height: 1.8;
    color: #444;
    text-align: left;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
}

.single-song .telugu-lyrics {
    font-size: 22px;
    line-height: 2.0;
    letter-spacing: 0.5px;
    word-spacing: 5px;
    margin-bottom: 30px;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
}

.single-song .telugu-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #eee;
}

.single-song .telugu-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.single-song .section-title {
    font-size: 18px;
    color: #e91e63;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid #e91e63;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.single-song .section-title:hover {
    padding-left: 15px;
}

.single-song .lyrics-divider {
    height: 3px;
    background: linear-gradient(90deg, transparent, #e91e63, transparent);
    margin: 25px 0;
    border: none;
}

.single-song .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.single-song .telugu-section {
    animation: fadeIn 0.5s ease forwards;
}

.single-song .telugu-section:nth-child(2) { animation-delay: 0.1s; }
.single-song .telugu-section:nth-child(3) { animation-delay: 0.2s; }
.single-song .telugu-section:nth-child(4) { animation-delay: 0.3s; }

/* =============================================
   Notifications & Animations
   ============================================= */
.favorite-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: var(--transition-normal);
    pointer-events: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* =============================================
   Telugu Font Support
   ============================================= */
@font-face {
    font-family: 'Noto Sans Telugu';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/notosanstelugu/v20/0nkoC9D4IuYgf0tTYU-DQlER2_07VKf3k6d8Xo4RLg.woff2) format('woff2');
    unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+200C-200D, U+25CC;
}

body, h1, h2, h3, h4, h5, h6, div, span, p, a, button {
    font-family: 'Noto Sans Telugu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.category-letter {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Responsive Styles
   ============================================= */
@media (max-width: 768px) {
    .song-item {
        padding: 10px 12px;
        min-height: 65px;
    }
    
    .song-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .song-title {
        font-size: 15px;
    }
    
    .song-subtitle {
        font-size: 12px;
    }
    
    .favorite-btn i {
        font-size: 22px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .category-letter {
        font-size: 30px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .page-section-title h2 {
        font-size: 1.5rem;
    }
    
    .banner-container {
        min-height: 150px;
    }
    
    .banner-container img {
        max-height: 150px;
    }
    
    .single-song .song-title {
        font-size: 24px;
    }
    
    .single-song .telugu-lyrics {
        font-size: 20px;
    }
    
    .single-song .lyrics-container {
        padding: 25px 15px;
    }

    .song-item-placeholder {
        height: 65px;
    }
}

@media (max-width: 480px) {
    .song-item {
        gap: 10px;
        min-height: 62px;
    }
    
    .song-details {
        padding-right: 5px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .category-letter {
        font-size: 28px;
    }
    
    .page-icon-header i {
        font-size: 60px;
        width: 100px;
        height: 100px;
        line-height: 100px;
    }
    
    .icon-page-content {
        padding: 20px 15px;
    }
    
    .single-song .song-title {
        font-size: 22px;
    }
    
    .single-song .telugu-lyrics {
        font-size: 19px;
        line-height: 1.85;
    }
    
    .single-song .lyrics-container {
        padding: 20px 15px;
    }
    
    .single-song .song-header {
        padding: 20px 15px;
    }
    
    .single-song .song-meta {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .single-song .action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .page-section-title h2 {
        font-size: 1.3rem;
    }
    
    .banner-container {
        min-height: 120px;
    }
    
    .banner-container img {
        max-height: 120px;
    }

    .song-item-placeholder {
        height: 62px;
    }
}

/* =============================================
   Pagination Styles
   ============================================= */
.pagination-wrap {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
}

.pagination-wrap .page-numbers {
    display: inline-flex;
    gap: 8px;
}

.pagination-wrap .page-numbers a,
.pagination-wrap .page-numbers span {
    display: inline-block;
    padding: 8px 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.pagination-wrap .page-numbers a:hover {
    background: var(--primary-color);
    color: var(--white);
}

.pagination-wrap .page-numbers .current {
    background: var(--primary-color);
    color: var(--white);
}

/* =============================================
   Utility Classes
   ============================================= */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* =============================================
   Telugu Letters Grid Specific Enhancements
   ============================================= */
.category-grid.telugu-letters-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
}

.category-grid.telugu-letters-grid .category-item {
    min-height: 80px;
    padding: 15px 5px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.category-grid.telugu-letters-grid .category-item.has-songs:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #E91E63, #FF9800);
    color: #ffffff;
}

.category-grid.telugu-letters-grid .category-letter {
    font-size: 36px;
    margin-bottom: 0;
    display: block;
    color: inherit;
}

.category-grid.telugu-letters-grid .category-letter:after {
    content: "";
    display: block;
    margin-top: 5px;
    height: 2px;
    width: 30px;
    background: rgba(0,0,0,0.1);
    margin: 5px auto 0;
}

@supports not (font-family: 'Noto Sans Telugu') {
    .category-letter {
        font-family: Arial, sans-serif;
    }
}

/* =============================================
   Telegram Icon Styling
   ============================================= */
.fa-telegram-plane {
    color: #0088cc;
}

/* =============================================
   Back Button Styles
   ============================================= */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    margin: 0 15px 15px;
    transition: var(--transition-fast);
    will-change: transform, box-shadow;
}

.back-button:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.song-back-btn, .category-back-btn {
    padding: 10px 0;
    position: relative;
    z-index: 1;
}

.song-back-btn {
    padding-top: 20px;
}

.category-back-btn {
    padding: 15px 0 10px;
}