/* --- VYSVĚTLENÍ: CSS PROMĚNNÉ (:root) --- 
    Tady si definujeme barvy jako "proměnné". Místo toho, abychom 
    psali všude #8E9775, napíšeme var(--accent-green). Když pak budeme 
    chtít změnit zelenou na modrou, změníme to jen tady na jednom místě. */
:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --header-bg: #1B262C;
    --accent-green: #8E9775;
    --accent-hover: #e84118;
    --text-light: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.video-kontejner {
  max-width: 550px;
  margin: 20px auto;
  text-align: center;
  font-family: Arial, sans-serif;
}

video {
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#tlacitkoPlay {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#tlacitkoPlay:hover {
  background-color: #0056b3;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.dark-mode { 
    --bg-color: #121212; 
    --text-color: #e0e0e0; 
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h3 {
    color: white;
}

/* --- VYSVĚTLENÍ: PŘILEPENÁ HLAVIČKA (position: sticky) --- */
.header-wrapper {
    border-bottom: 5px solid var(--accent-green);
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    background-color: #1d1616; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header {
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 25px 20px; /* Původně bylo 15px – zvětšením na 25px (nebo více) header nafoukneš */
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

nav.hlavni-menu ul { 
    display: flex; 
    list-style: none; 
    gap: 30px; 
}

nav.hlavni-menu ul li a { 
    text-decoration: none; 
    color: var(--text-light); 
    font-weight: bold; 
    transition: color 0.2s; 
}

nav.hlavni-menu ul li a:hover { 
    color: var(--accent-green); 
}

section { 
    max-width: 100%; /* Roztáhnuto na celou šířku */
    margin: 20px auto 0 auto; /* Přidána mezera 20px nahoře, aby se odlepila od headeru */
    padding: 0px;   
    color: rgb(63, 59, 59);
}

main { 
    max-width: 1200px; 
    margin: 20px auto 47px; 
    padding: 20px; 
    width: 100%;
    flex: 1;
}

main h2 { 
    text-align: center; 
    font-weight: bold; 
    margin-bottom: 20px; 
    color: inherit; 
}

form {
    padding: 20px;
}

.subtitle { 
    text-align: center; 
    color: var(--accent-green); 
    margin-bottom: 20px;
}

.vprostred { 
    margin: 0 auto 20px auto; 
    max-width: 600px; 
}

#hero-section {
    background-image: url('img/uvodn.jpeg');
    background-size: cover;      
    background-position: center; 
    background-repeat: no-repeat;
    background-color: var(--header-bg); 
    color: var(--text-light);
    text-align: center;
    border-radius: 0px; /* Odstraněny kulaté rohy pro plné roztáhnutí */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 130px 20px; /* Zvětšený vnitřní okraj pro lepší výšku */
}

/* --- VYHLEDÁVÁNÍ A FILTRY --- */
.search-container { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 10px; 
}

#search-input { 
    margin: 15px 0; 
    padding: 8px 15px; 
    border: 1px solid #ccc; 
    border-radius: 20px; 
    outline: none; 
    width: 250px; 
}

.category-filters {
    text-align: center;
    margin-bottom: 25px;
}

/* --- VYSVĚTLENÍ: MŘÍŽKA S PŘESNÝM POČTEM SLOUPCŮ --- */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    padding: 20px 0;
}

.wallpaper-card {
    background: #fff; 
    border-radius: 15px; 
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    transition: transform 0.3s;
}

.dark-mode .wallpaper-card { 
    background: #2d2d2d; 
    color: white; 
}

.wallpaper-card:hover { 
    transform: translateY(-5px); 
}

/* --- VYSVĚTLENÍ: DOKONALÝ ČTVEREC --- */
.wallpaper-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1; 
    background: linear-gradient(135deg, #e0e0e0 0%, #cccccc 100%);
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #666; 
    font-weight: bold; 
    font-size: 0.9rem;
}

.dark-mode .wallpaper-placeholder { 
    background: linear-gradient(135deg, #444 0%, #333 100%); 
    color: #aaa; 
}

.wallpaper-actions { 
    padding: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.like-btn {
    background: #f0f0f0 !important; 
    color: #333 !important;
    border: none; 
    padding: 6px 12px !important; 
    border-radius: 20px !important;
    cursor: pointer; 
    font-family: 'Montserrat', sans-serif; 
    transition: all 0.2s; 
    font-size: 0.8rem;
    transform: none !important;
    box-shadow: none !important;
}

.dark-mode .like-btn { 
    background: #444 !important; 
    color: white !important; 
}

.like-btn.aktivni { 
    background: #ff4757 !important; 
    color: white !important; 
}

.download-btn { 
    text-decoration: none; 
    color: #3498db; 
    font-weight: 700; 
    font-size: 0.8rem; 
}

/* --- TLAČÍTKA OBECNĚ --- */
button, .btn, .btn-main {
    background-color: var(--accent-green); 
    color: var(--text-light); 
    border: none;
    padding: 12px 25px; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700;
    cursor: pointer; 
    border-radius: 50px; 
    transition: 0.3s; 
    text-decoration: none; 
    display: inline-block;
}

button:hover, .btn:hover, .btn-main:hover { 
    background-color: var(--accent-hover); 
    transform: scale(1.05); 
}

/* --- PATIČKA --- */
footer {
    background-color: var(--header-bg); 
    color: var(--text-light); 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 10px; 
    padding: 15px 10px;
    margin-top: auto; 
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* --- MODÁLNÍ OKNO PŘES CELOU OBRAZOVKU --- */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
}

.modal-content {
    background-color: var(--bg-color); 
    color: var(--text-color); 
    padding: 40px;
    border-radius: 12px; 
    max-width: 500px; 
    width: 90%; 
    position: relative; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hidden { 
    display: none !important; 
}

.close-btn {
    position: absolute; 
    top: 15px; 
    right: 20px; 
    font-size: 28px; 
    background: none; 
    border: none;
    color: var(--text-color); 
    cursor: pointer; 
    padding: 0;
}

.close-btn:hover { 
    color: var(--accent-hover); 
}

/* --- CÍLENÁ TAPETA Z URL (:target) --- */
.skryty-obsah {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    text-align: center;
    padding-top: 50px;
}

.dark-mode .skryty-obsah {
    background: rgba(18, 18, 18, 0.95);
}

#moje-tapeta:target {
    display: block;
}

.okno {
    display: inline-block;
    padding: 20px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    background-color: var(--bg-color);
}

.tlacitka-zpet {
    display: block;
    margin-top: 20px;
    text-decoration: none;
    font-weight: bold;
    color: #e84118;
}

/* --- STYL PRO BOČNÍ MENU --- */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px; 
    width: 300px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-in-out; 
    z-index: 9999; 
    padding: 30px 20px;
    box-sizing: border-box;
}

.side-menu.otevreno {
    right: 0; 
}

.side-menu .close-btn {
    background: none;
    border: none;
    font-size: 35px;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-color); 
}

body.dark-mode .side-menu {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* --- VYSVĚTLENÍ: MOBILNÍ ZOBRAZENÍ (@media) --- */
@media (max-width: 900px) { 
    .wallpaper-grid { grid-template-columns: repeat(2, 1fr); } 
}

@media (max-width: 500px) { 
    .wallpaper-grid { grid-template-columns: 1fr; } 
}