/* ========================================
   RESET & BASE
======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color, #f0f2f5);
    color: var(--text-color, #222);
    position: relative;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

.container {
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ========================================
   TITLURI PRINCIPALE (index / post)
======================================== */
.container h2,
.post-page h1 {
    text-align: center;
    font-weight: 600;
    color: var(--text-color, #222);
    position: relative;
    opacity: 0;
    animation: fadeInDown 0.9s ease forwards;
}

/* Titlu principal (index) */
.container h2 {
    font-size: 2em;
    margin-top: 1px; /* spațiu suficient sub header */
    margin-bottom: 5px;
}

/* Linie decorativă sub titluri */
.container h2::after,
.post-page h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff0055, #ff7b00);
    margin: 8px auto 0;
    border-radius: 2px;
    opacity: 0;
    animation: fadeInLine 1.2s ease forwards;
    animation-delay: 0.6s;
}

/* Titlu în pagina de post */
.post-page h1 {
    font-size: 1.8em;
    margin: 1px auto 3px; /* spațiu mai mare ca să nu fie acoperit de header */
    line-height: 1.3;
}

.post-page h1::after {
    width: 80px;
    margin-top: 10px;
}

/* 🔧 Fix pentru mobil */
@media (max-width: 768px) {
    .container h2 {
        margin-top: 1px; /* mai mult spațiu pe mobil */
        font-size: 1.0em;
    }

    .post-page h1 {
        margin-top: 30px;
        font-size: 0.9em;
    }
}


/* ========================================
   HEADER PREMIUM
======================================== */
header {
    position: fixed; /* in loc de sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg, rgba(15,15,15,0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease, background 0.4s ease;
}


.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-wrap: wrap;
}

/* Fix overlap între header și conținut */
main.container,
.post-page {
    padding-top: 30px; /* spațiu sub header */
}

@media (max-width: 768px) {
    main.container,
    .post-page {
        padding-top: 120px; /* pe mobil headerul e mai mare, deci spațiu mai generos */
    }
}


/* LOGO ANIMAT */
.logo {
    font-size: 2em;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: inline-block;
    transition: transform 0.3s ease;
}
.logo:hover { transform: scale(1.05); }
.logo-main { color: var(--accent, #ff0055); }
.logo-glow {
    color: #fff;
    background: linear-gradient(90deg, #ff0055, #ff2bdc, #009fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoGradient 6s linear infinite;
    margin-left: 5px;
    font-weight: 800;
}
body.dark-mode .logo-glow {
    animation: logoGradient 6s linear infinite, logoPulse 3s ease-in-out infinite;
}

/* NAVBAR */
.main-nav {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}
.main-nav a {
    color: #ddd;
    text-decoration: none;
    font-size: 1em;
    transition: all 0.3s ease;
    position: relative;
}
.main-nav a:hover { color: #ff0055; }
.main-nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff0055, #ff7b00);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.main-nav a:hover::after { width: 60%; }

/* DARK/LIGHT TOGGLE */
#theme-toggle {
    background: none;
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

body {
    background-color: #121212;
    color: #f0f0f0;
}
body.dark-mode {
    background-color: #121212; /* deja dark */
    color: #f0f0f0;
}
body.light-mode {
    background-color: #fff;
    color: #222;
}

#theme-togg
le:hover { background: rgba(255,255,255,0.1); transform: rotate(10deg); }
#theme-toggle .moon { display: none; }
body.dark-mode #theme-toggle .sun { display: none; }
body.dark-mode #theme-toggle .moon { display: inline; }

/* ========================================
   CARDS PREMIUM (INDEX / TILE) ADAPTIVE
======================================== */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 carduri desktop mare */
    gap: 25px;
    margin-top: 20px;
}

.post-card-tile {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card-tile:hover {
    transform: translateY(-7px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.thumb-container-tile {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio */
    border-radius: 12px;
    overflow: hidden;
    background-color: #ddd;
}

.thumb-container-tile img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* imagine completă, acoperă tot cardul */
    transition: transform 0.3s;
}

.thumb-container-tile:hover img {
    transform: scale(1.05);
}

.overlay-tile {
    position: absolute;
    bottom: 0;           /* titlul jos */
    left: 0;
    width: 100%;
    padding: 10px 8px;
    background: rgba(0,0,0,0.55); /* semi-transparent */
    text-align: center;
}

.overlay-tile h3 {
    color: #fff;
    font-size: 0.9em; /* titlu mai vizibil */
    margin: 0;
    line-height: 1.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   RESPONSIVE GRID CARDS
======================================== */
@media(max-width: 1280px) {
    .cards-container { grid-template-columns: repeat(3, 1fr); } /* 3 carduri desktop mic */
}

@media(max-width: 1024px) {
    .cards-container { grid-template-columns: repeat(2, 1fr); } /* 2 carduri tablet */
}

@media(max-width: 480px) {
    .cards-container { grid-template-columns: 1fr; } /* 1 card mobil */
    .overlay-tile h3 { font-size: 1.1em; }
}



/* ========================================
   SIMILAR POSTS - GRID & CARDS
======================================== */
.similar-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 carduri desktop mare */
    gap: 20px;
    margin-top: 20px;
}

.similar-posts .post-card-tile {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.similar-posts .post-card-tile:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.similar-posts .thumb-container-tile {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    background-color: #ddd;
}

.similar-posts .thumb-container-tile img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.similar-posts .thumb-container-tile:hover img {
    transform: scale(1.05);
}

.similar-posts .overlay-tile {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 6px;
    background: rgba(0,0,0,0.55);
    text-align: center;
}

.similar-posts .overlay-tile h3 {
    color: #fff;
    font-size: 1em;
    margin: 0;
    line-height: 1.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   RESPONSIVE GRID SIMILAR POSTS
======================================== */
@media(max-width: 1280px) {
    .similar-posts { grid-template-columns: repeat(3, 1fr); }
}

@media(max-width: 1024px) {
    .similar-posts { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 480px) {
    .similar-posts { grid-template-columns: 1fr; }
    .similar-posts .overlay-tile h3 { font-size: 1.05em; }
}
@media(max-width: 480px) {
    .similar-posts {
        margin-top: 30px; /* spațiu mai mare sub video */
    }
}



/* ========================================
   VIDEO / IFRAME PAGINĂ POST
======================================== */

.video-container {
    width: 100%;
    margin-bottom: 1px;
    position: relative;
    padding-top: 35%; /* mai mic decât 16:9 pentru desktop */
}

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

/* Tablet / Mobil mediu */
@media(max-width: 768px) {
    .video-container {
        padding-top: 65%; /* mai înalt pe tablet */
    }
}

/* Mobil mic */
@media(max-width: 480px) {
    .video-container {
        padding-top: 75%; /* mai înalt pe telefoane */
    }
}

/* Similar posts - menținem distanța sub player */
.similar-posts {
    margin-top: 20px; /* spațiu default */
}

@media(max-width: 480px) {
    .similar-posts {
        margin-top: 30px; /* mai mult spațiu pe mobil */
    }
}



/* ========================================
   FOOTER
======================================== */
footer {
    text-align: center;
    padding: 25px;
    background: #1c1c1c;
    color: #fff;
    margin-top: 30px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========================================
   PAGINATION - Modern with Arrows
======================================== */
.pagination {
    margin: 40px 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 10px 16px;
    margin: 0 4px;
    background: #ffffff;
    color: #333333;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.25s ease-in-out;
    font-weight: 500;
    gap: 4px;
}

.pagination a:hover {
    background: #333333;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pagination a.active {
    background: #ff0055;
    color: #ffffff;
    border-color: #ff0055;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255,0,85,0.4);
}

.pagination a.prev,
.pagination a.next {
    font-weight: 600;
    font-size: 0.95em;
}

.pagination a.prev::before {
    content: "←";
    margin-right: 6px;
}

.pagination a.next::after {
    content: "→";
    margin-left: 6px;
}

@media (max-width: 480px) {
    .pagination a {
        padding: 8px 12px;
        min-width: 36px;
        font-size: 0.9em;
    }

    .pagination a.prev::before,
    .pagination a.next::after {
        margin: 0 4px;
    }
}



/* ========================================
   ANIMAȚII
======================================== */
@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLine {
    0% { opacity: 0; transform: scaleX(0); }
    100% { opacity: 1; transform: scaleX(1); }
}
@keyframes logoPulse {
    0%, 100% { text-shadow: 0 0 10px rgba(255,0,100,0.4); }
    50% { text-shadow: 0 0 25px rgba(255,0,150,0.8); }
}
@keyframes logoGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   RESPONSIVE
======================================== */
@media(max-width:1024px) {
    .thumb-container-tile { padding-top: 50%; }
    .video-container iframe { height: 350px; }
}
@media(max-width:768px) {
    .thumb-container-tile { padding-top: 60%; }
    .video-container iframe { height: 300px; }
    .header-inner { flex-direction: column; gap: 1px; }
    .main-nav { justify-content: center; gap: 15px; }
    .logo { font-size: 1.6em; }
}
@media(max-width:480px) {
    .thumb-container-tile { padding-top: 70%; }
    .overlay-tile h3 { font-size: 1.1em; }
    .video-container iframe { height: 220px; }
}


:root {
  --bg-color: #f0f2f5;
  --text-color: #222;
  --card-bg: #fff;
  --header-bg: rgba(15,15,15,0.9);
  --accent: #ff0055;
}

body.dark-mode {
  --bg-color: #0f0f0f;
  --text-color: #eee;
  --card-bg: #1c1c1c;
  --header-bg: rgba(10,10,10,0.95);
}

body, header, .post-card, .post-card-tile, .thumb-container-tile, footer {
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.4s ease, color 0.4s ease;
}

.post-card-tile, .post-card {
  background: var(--card-bg);
}

header {
  background: var(--header-bg);
}


/* ========================================
   CATEGORIES GRID
======================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 10px;
    background: #f5f5f5;
    border-radius: 10px;
    font-weight: 600;
    text-transform: capitalize;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-card:hover {
    background: linear-gradient(135deg, #ff0055, #ff7b00);
    color: #fff;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* ==========================
   Responsive adjustments
========================== */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 coloane pe tabletă */
        gap: 14px;
    }
    .category-card {
        padding: 15px 8px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 coloane pe mobil */
        gap: 10px;
    }
    .category-card {
        padding: 12px 6px;
        font-size: 0.85em;
    }
}


/* ========================================
   Search
======================================== */
.search-form {
  display: inline-block;
}
.search-form input {
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
}

.search-results {
  position: absolute;
  background: #e3dada;
  color: #fff;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 6px;
  margin-top: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 1000;
}

.search-results a {
  display: flex;
  align-items: center;
  padding: 8px;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid #333;
}

.search-results a img {
  width: 50px;
  height: 28px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 4px;
}

.search-results a:hover {
  background: #ff0055;
}

/* ===== FIX pentru header fix pe mobil ===== */
main.container {
    padding-top: calc(var(--header-height, 90px) + 30px);
}

/* Dimensiune implicită header desktop */
:root {
    --header-height: 80px;
}

/* Pe mobil, headerul e mai înalt, deci ajustăm */
@media (max-width: 768px) {
    :root {
        --header-height: 130px;
    }
}

/* ===== TAGS ===== */

.post-tags {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tags .tag-item {
    display: inline-block;
    background: linear-gradient(135deg, #ff0055, #ff7b00);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px; /* face efectul “pill” */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
}

.post-tags .tag-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    opacity: 0.9;
}

