/* 
   Main CSS system for Tekstovi.rs
   Rich Minimalist Design, Light Theme, Premium Typography (Inter & Newsreader)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap');

:root {
    /* HSL Color System - Blue & Red */
    --primary-h: 221;
    --primary-s: 83%;
    --primary-l: 53%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    
    /* Red details */
    --accent: hsl(354, 85%, 56%);
    --gradient: linear-gradient(135deg, var(--primary), hsl(221, 90%, 40%));
    
    /* Light Mode Palette */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --selection-bg: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
    
    /* Layout Constants */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-poet {
    --primary-h: 345;
    --primary-s: 75%;
    --primary-l: 38%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    --gradient: linear-gradient(135deg, var(--primary), hsl(345, 80%, 25%));
    --selection-bg: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
}

/* Force light theme regardless of system dark-theme preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #f8fafc;
        --bg-card: #ffffff;
        --text: #0f172a;
        --text-muted: #64748b;
        --border: #e2e8f0;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
        --selection-bg: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
    }
}

body.light-theme, body.dark-theme {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.logo, .nav-links, .nav-link,
.search-input, .btn, .action-btn,
.card-title, .card-meta, .card-action,
.sort-link, .alphabet-letter, .back-link,
.album-header-title, .album-header-meta,
.song-list-title, .song-list-views,
.artist-sidebar-title, .artist-sidebar-meta,
.sorting-selector {
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800; /* Extra bold for Inter headings */
    letter-spacing: -0.8px;
    line-height: 1.25;
}

::selection {
    background-color: var(--selection-bg);
}

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

/* Layout Containers */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.85); /* Slightly opaque light bg */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
}

.navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-search-form {
    flex: 1;
    max-width: 320px;
    margin: 0 20px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    transition: var(--transition);
}

.nav-link-music:hover, .nav-link-music.active {
    color: hsl(221, 83%, 53%) !important;
}

.nav-link-music::after {
    background-color: hsl(221, 83%, 53%);
}

.nav-link-music:hover::after, .nav-link-music.active::after {
    width: 100%;
}

.nav-link-poet:hover, .nav-link-poet.active {
    color: hsl(345, 75%, 38%) !important;
}

.nav-link-poet::after {
    background-color: hsl(345, 75%, 38%);
}

.nav-link-poet:hover::after, .nav-link-poet.active::after {
    width: 100%;
}


.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background-color: var(--border);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 2.7rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px auto;
}

/* Search Bar Component */
.search-wrapper {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    outline: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.search-wrapper:focus-within .search-icon {
    color: var(--primary);
}

/* Grid Layouts */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    height: auto;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.25;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.card-action {
    align-self: flex-start;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

/* Artist Profile Page */
.artist-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.artist-header-info h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.artist-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.meta-tag {
    background-color: var(--border);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.artist-bio {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-line;
}

/* Song List (Artist page) */
.song-list-group {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.song-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.song-list-item:last-child {
    border-bottom: none;
}

.song-list-item:hover {
    background-color: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.03);
}

.song-list-info {
    display: flex;
    flex-direction: column;
}

.song-list-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.song-list-album {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.song-list-views {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Lyrics Page styling - Crucial for readable content */
.lyrics-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 768px) {
    .lyrics-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.lyrics-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    position: relative;
}

.lyrics-header {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.lyrics-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.lyrics-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.lyrics-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.report-box {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
}

.report-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.report-box-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.report-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}

.report-close-btn:hover {
    color: var(--text);
}

.lyrics-bottom-report {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}

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

.action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    transition: var(--transition);
}

.action-btn:hover {
    background-color: var(--border);
}

.action-btn.active {
    background-color: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* The actual lyrics text area - highly optimized for reading */
.lyrics-body {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap; /* preserves line breaks and spacing */
    letter-spacing: 0.1px;
    transition: font-size 0.2s ease;
}

/* Sidebar components */
.sidebar-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.sidebar-box-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Alphabet search listing */
.alphabet-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.alphabet-letter {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.alphabet-letter:hover, .alphabet-letter.active {
    background: var(--gradient);
    color: #ffffff;
    border-color: transparent;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 36px;
    background-color: var(--bg-card);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 28px;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-partners-wrapper {
    max-width: 920px;
    margin: 0 auto 24px;
    padding: 22px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.footer-partner-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.footer-partner-links a {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-partner-links a:hover {
    color: var(--primary);
    background-color: var(--bg-card);
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.footer-copy {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-copy strong {
    color: var(--text);
    font-weight: 600;
}

/* Back button */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--text);
}

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

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Admin view simple styling overrides */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

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

.admin-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.admin-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg);
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.admin-form-control:focus {
    border-color: var(--primary);
}

.btn {
    background: var(--gradient);
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: var(--border);
    transform: none;
}

.btn-danger {
    background: hsl(0, 84%, 60%);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th, .admin-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background-color: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.05);
    font-weight: 600;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

/* Album Header Card Design */
.album-section {
    margin-top: 36px;
    margin-bottom: 24px;
}

.album-header-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.album-header-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-glow);
}

.album-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    color: var(--primary);
}

.album-header-details {
    flex: 1;
}

.album-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-main);
}

.album-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.album-meta-item strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Mobilni responsivni stilovi za administraciju i zaglavlje */
@media (max-width: 600px) {
    .nav-search-form {
        display: none !important; /* Sakrij brzu pretragu u navbaru na mobilnom da oslobodimo mesto */
    }
    
    .navbar {
        padding: 12px 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Admin header responsivni raspored */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 24px;
        text-align: left;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
        margin: 0;
    }
    
    .admin-user-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 12px;
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }
    
    .admin-user-info {
        font-size: 0.85rem;
    }
    
    .btn-logout {
        color: hsl(0, 84%, 60%) !important;
        border-color: hsl(0, 84%, 60%) !important;
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
    
    /* Odzivnost tabela na mobilnom */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 16px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        background-color: var(--bg-card);
    }
    
    .admin-table {
        margin-top: 0;
        box-shadow: none;
    }
    
    .admin-table th, .admin-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap; /* Sprečava neprirodan prelom teksta u tabeli */
    }
    
    /* Akcije u tabeli */
    .admin-actions {
        display: flex;
        gap: 6px;
    }
    
    .admin-actions .btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}
