/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6fa5;
    --primary-dark: #3a5a8c;
    --secondary-color: #6b8c42;
    --accent-color: #d4af37;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --gray-light: #ecf0f1;
    --gray: #bdc3c7;
    --success: #27ae60;
    --error: #e74c3c;
    --info: #3498db;
    --warning: #f39c12;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    flex-wrap: wrap;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo {
    height: 40px;
    margin-right: 10px;
}

/* Mobile Menu Toggle - Hidden on Desktop by default */
.mobile-menu-toggle {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: var(--gray-light);
}

/* Search Bar */
.nav-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-box {
    position: relative;
    display: flex;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.search-box button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 15px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* Main Navigation Menu - Desktop */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-light);
}

.nav-link.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 8px 16px;
}

.nav-link.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dropdown Styles */
.nav-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-light);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* Flash Messages - UPDATED */
.flash-messages {
    margin: 1rem auto;
    max-width: 1200px;
    padding: 0 20px;
}

.flash-message {
    padding: 15px 20px;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInDown 0.3s ease-out;
}

.flash-message.success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.flash-message.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.flash-message.info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

.flash-message.warning {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 10px;
    opacity: 0.7;
    transition: var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Languages Section */
.languages-section {
    padding: 60px 0;
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.language-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.language-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--white);
    font-size: 2rem;
}

.category-stats {
    margin: 1.5rem 0;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.stat:last-child {
    border-bottom: none;
}

.count {
    font-weight: 600;
    color: var(--primary-color);
}

/* Hymns Grid */
.hymns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.hymn-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.hymn-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--white);
    font-size: 3rem;
}

.language-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.hymn-content {
    padding: 1.5rem;
}

.hymn-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.hymn-meta {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.hymn-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--secondary-color), #5a7c32);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.newsletter-content h2 {
    margin-bottom: 1rem;
}

.newsletter-content p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
}

.newsletter-form button {
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #e6b412;
    transform: translateY(-2px);
}

/* Footer - COMPREHENSIVE STYLES */
.footer {
    background: #f8f9fa;
    color: #333;
    padding: 60px 0 20px;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: #2c3e50;
}

.footer-logo img {
    height: 30px;
    margin-right: 10px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: #6c757d;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: #3498db;
    transform: translateY(-2px);
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Ensure footer sections are always visible */
.footer-section {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Audio Player */
.audio-player {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress {
    position: absolute;
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.form-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 15px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.page-link:hover, .page-link.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Admin Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--text-dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.admin-brand img {
    height: 30px;
}

.admin-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--accent-color);
}

.nav-item.logout {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.nav-item.logout:hover {
    color: var(--white);
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    background: var(--bg-light);
    min-height: 100vh;
}

.admin-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.admin-header p {
    margin: 0.2rem 0 0 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.admin-content {
    padding: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--text-dark);
}

.stat-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-trend {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--error);
}

/* Table Styles */
.hymns-table {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hymns-table table {
    width: 100%;
    border-collapse: collapse;
}

.hymns-table th,
.hymns-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.hymns-table th {
    background: var(--gray-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.hymns-table tr:hover {
    background: rgba(74, 111, 165, 0.05);
}

.hymn-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hymn-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.hymn-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.2rem 0 0 0;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn-icon {
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.table-actions .btn-icon:hover {
    background: var(--gray-light);
}

.table-actions .btn-icon.danger:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error);
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    flex-wrap: wrap;
    gap: 1rem;
}

.bulk-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Social Share Styles */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1.1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

/* Hymn Detail Audio Section */
.audio-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Comment and Rating Styles */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-light);
}

.comment-form {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.rating-stars {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: #ffc107 !important;
}

.rating-stars input:checked ~ label {
    color: #ffc107;
}

.comments-list {
    margin-top: 20px;
}

.comment-item {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.comment-item:hover {
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-user {
    font-weight: 500;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-rating {
    color: #ffc107;
    display: flex;
    align-items: center;
    gap: 2px;
}

.comment-date {
    color: var(--text-light);
    font-size: 0.9em;
}

.comment-content {
    color: var(--text-dark);
    line-height: 1.5;
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Profile Styles */
.profile-container {
    padding: 2rem 0;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-avatar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
    flex-shrink: 0;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.profile-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
}

.profile-nav {
    display: flex;
    flex-direction: column;
}

.profile-nav .nav-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.profile-nav .nav-item:hover,
.profile-nav .nav-item.active {
    background: var(--primary-color);
    color: var(--white);
    border-left-color: var(--accent-color);
}

.profile-main {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-light);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.form-help {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray);
    opacity: 0.7;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.empty-state p {
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
}

.empty-state-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Compact Hymn Cards */
.hymns-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.hymn-card.compact .hymn-image {
    height: 120px;
    font-size: 2rem;
}

.hymn-card.compact .hymn-content {
    padding: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Auth Pages */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.forgot-link:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-light);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-light);
}

.auth-divider span {
    background: var(--white);
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-google {
    background: #db4437;
    color: white;
}

.btn-google:hover {
    background: #c23321;
    transform: translateY(-2px);
}

.btn-facebook {
    background: #4267B2;
    color: white;
}

.btn-facebook:hover {
    background: #365899;
    transform: translateY(-2px);
}

.auth-features {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.feature-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.feature-item p {
    opacity: 0.8;
    line-height: 1.6;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label.large {
    align-items: flex-start;
}

.checkbox-label.large .checkmark {
    margin-top: 2px;
}

.checkbox-label.large div {
    flex: 1;
}

.checkbox-label.large strong {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.checkbox-label.large p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert i {
    font-size: 1.2rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.alert div p {
    margin: 0.2rem 0;
}

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

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.ml-1 { margin-left: 1rem; }
.mr-1 { margin-right: 1rem; }

.hidden {
    display: none !important;
}

.favorite-active {
    color: var(--error) !important;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Loading animation for better UX */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: black; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 black, .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 black, .5em 0 0 black; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .action-buttons,
    .comments-section,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* MOBILE RESPONSIVE STYLES - FIXED VERSION */
@media (max-width: 768px) {
    /* Mobile Navigation Container */
    .nav-container {
        padding: 8px 15px;
        flex-wrap: nowrap;
        min-height: 60px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Mobile Menu Toggle - FORCE VISIBILITY */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        order: 3;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-dark);
        cursor: pointer;
        z-index: 1001;
        margin-left: auto;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile Navigation Menu - SIMPLIFIED */
    .nav-menu {
        display: none !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        overflow-y: auto;
        height: calc(100vh - 60px);
        gap: 0;
        align-items: stretch;
        visibility: hidden;
    }
    
    .nav-menu.active {
        display: flex !important;
        visibility: visible;
    }
    
    /* Mobile menu links */
    .nav-link {
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-light);
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        min-height: 50px;
        font-weight: 500;
        text-decoration: none;
        color: var(--text-dark);
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .nav-link:hover {
        background: var(--gray-light);
        color: var(--text-dark);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link.btn-primary {
        margin: 15px 20px;
        width: calc(100% - 40px);
        text-align: center;
        border-radius: var(--border-radius);
        justify-content: center;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        font-weight: 600;
        border: none;
    }
    
    .nav-link.btn-primary:hover {
        background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
        color: white;
        transform: none;
    }
    
    /* Mobile Dropdown Styles */
    .nav-dropdown {
        width: 100%;
        position: relative;
    }
    
    .nav-dropdown .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-right: 20px;
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background: var(--gray-light);
        border-radius: 0;
        border-left: 4px solid var(--primary-color);
    }
    
    .nav-dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        padding: 14px 20px 14px 40px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        font-size: 1rem;
        min-height: 50px;
        display: flex;
        align-items: center;
        color: var(--text-dark);
        text-decoration: none;
        font-weight: 400;
        background: none;
        border: none;
        width: 100%;
        text-align: left;
    }
    
    .dropdown-content a:hover {
        background: rgba(74, 111, 165, 0.1);
        color: var(--primary-color);
    }
    
    /* Container adjustments */
    .container {
        padding: 0 15px;
    }
    
    /* Hero section mobile fixes */
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Hymns grid mobile fixes */
    .hymns-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Profile page mobile fixes */
    .profile-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .profile-avatar {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-stats {
        justify-content: space-around;
        width: 100%;
    }
    
    /* Hymn detail page mobile fixes */
    .audio-section {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .share-buttons {
        justify-content: center;
        margin: 1rem 0 0 0;
        width: 100%;
    }
    
    /* Comments section mobile fixes */
    .comment-form {
        padding: 1rem;
    }
    
    .rating-stars {
        justify-content: center;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Admin panel mobile fixes */
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        flex: 1;
        min-width: 120px;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--accent-color);
    }
    
    /* Stats grid mobile fixes */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    /* Table mobile fixes */
    .hymns-table {
        overflow-x: auto;
    }
    
    .hymns-table table {
        min-width: 600px;
    }
    
    /* Admin content adjustments */
    .admin-content {
        padding: 1rem;
    }
    
    .admin-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .content-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Auth pages mobile fixes */
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-features {
        display: none;
    }
    
    .auth-card {
        padding: 2rem 1rem;
    }
    
    .social-auth {
        grid-template-columns: 1fr;
    }
    
    /* Flash messages mobile fixes */
    .flash-messages {
        padding: 0 15px;
    }
    
    .flash-message {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .flash-close {
        margin-left: 0;
    }
    
    /* Footer mobile fixes */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Newsletter form mobile */
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Utility classes for mobile */
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
}

/* Additional fix for very small screens */
@media (max-width: 480px) {
    .nav-container {
        padding: 8px 10px;
    }
    
    .nav-logo a {
        font-size: 1.1rem;
    }
    
    .logo {
        height: 28px;
    }
    
    .nav-search {
        margin: 0 10px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .content-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .content-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .bulk-buttons {
        justify-content: center;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ============================================= */
/* MOBILE MENU NUCLEAR OVERRIDE - ADDED AT THE END */
/* ============================================= */

/* NUCLEAR OPTION: Override everything for mobile menu */
@media (max-width: 768px) {
    /* Target by ID for maximum specificity */
    #navMenu.nav-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: none !important;
    }
    
    /* When active, override ALL previous styles */
    #navMenu.nav-menu.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        
        /* Force positioning */
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: white !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
        flex-direction: column !important;
        padding: 20px 0 !important;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
        height: calc(100vh - 60px) !important;
        gap: 0 !important;
        align-items: stretch !important;
    }
    
    /* Ensure toggle is always visible */
    #mobileMenuToggle.mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 10001 !important;
    }
}

/* Body lock override */
body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Flash Message Styles */
.alert {
    position: relative;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left-color: #27ae60;
    color: #27ae60;
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
    color: #e74c3c;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
    color: #3498db;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    font-size: 1rem;
}

.alert-close:hover {
    opacity: 0.7;
}

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