/* ==== Общи стилове за всички страници ==== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* ====== GALLERY (gallery.php) ====== */
body.gallery-page {
    color: #eee;
    text-align: center;
    background: #111;
}
header {
    width: 100%;
    background: rgba(0,0,0,0.5);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
header a {
    color: #fff; text-decoration:none; font-size:18px;
    font-weight:bold;
}
.upload-box {
    margin: 20px auto; padding: 15px; border: 2px dashed #666;
    width: 90%; max-width: 420px; background: rgba(0,0,0,0.5); border-radius: 10px;
}
input[type=file] { width: 100%; padding:5px; margin-bottom:10px; }
button { padding:10px 20px; border:none; border-radius:5px; background:#ff5599; color:#fff; font-size:16px; cursor:pointer; }
button:hover { background:#ff3366; }
.gallery { display:flex; flex-wrap: wrap; justify-content:center; gap:10px; margin:20px 0; }
.gallery img { width: 120px; height: 80px; object-fit: cover; border:3px solid #333; border-radius:10px; cursor:pointer; transition:0.3s; }
.gallery img:hover { border-color: lime; transform: scale(1.05); }
.current { border-color: yellow !important; }
.progress-container { width:90%; max-width:420px; background:#333; border-radius:5px; margin:10px auto; height:20px; display:none; overflow:hidden; }
.progress-bar { height:100%; width:0%; background:lime; border-radius:5px; transition: width .15s linear; }
@media (max-width:480px){
    .gallery img { width:90px; height:60px; }
    button { font-size:14px; padding:8px 16px; }
}
.message { margin-top:10px; }

/* ====== INDEX (index.php) ====== */
body.index-page {
    color: #b3002d;
    display: flex;
    flex-direction: column;
    justify-content: center;   /* центрира по вертикала */
    align-items: center;       /* центрира по хоризонтала */
    text-align: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}


/* wallpaper fade system */
body.index-page::before, body.index-page::after {
    content: "";
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: opacity 1.2s ease-in-out;
}
body.index-page::before { opacity: 1; background-image: var(--wallpaper); }
body.index-page::after  { opacity: 0; background-image: var(--wallpaper-new); }
body.index-page.fade-wallpaper::after { opacity: 1; }

h1 { font-size: 3em; margin-bottom: 20px; text-shadow: 1px 1px 4px rgba(179, 0, 45, 0.3); }
#counter { font-size: 2em; margin: 20px 0 10px 0; font-weight: 600; }
#message { font-size: 1.5em; color: #d94f5a; margin-bottom: 40px; min-height: 1.8em; }
.nice-text {
    font-size: 1.2em;
    color: #8a0037;
    max-width: 600px;
    line-height: 1.5;
    margin: 15px auto 10px auto;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 12px 16px;
}
.button-container { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 320px; }
.button {
    display: inline-block;
    padding: 14px 24px;
    background: linear-gradient(to right, #ff7eb3, #ff758c);
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(255, 105, 135, 0.3);
    transition: all 0.3s ease;
    width: 100%;
    user-select: none;
}
.button:hover, .button:focus {
    background: linear-gradient(to right, #ff5599, #ff3366);
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(255, 85, 153, 0.4);
    outline: none;
}
@media (max-width: 480px) {
    h1 { font-size: 2em; }
    #counter { font-size: 1.6em; }
    #message { font-size: 1.2em; margin-bottom: 30px; }
    .nice-text { font-size: 1em; max-width: 90vw; }
}

/* ====== STRANICI (stranici.php) ====== */
body.stranici-page {
    color: #b3002d;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#backBtn {
    align-self: flex-start;
    margin: 20px;
    background: none;
    border: none;
    color: #b3002d;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
#backBtn:hover { background-color: #ff7eb3; color: white; }
#backBtn svg { margin-right: 8px; width: 20px; height: 20px; fill: currentColor; }
ul { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 15px; }
li { width: 100%; }
a.page-link {
    display: block;
    text-decoration: none;
    background: linear-gradient(90deg, #ff7eb3, #ff758c);
    color: white;
    font-weight: 700;
    font-size: 1.2em;
    padding: 14px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(255, 105, 135, 0.3);
    transition: all 0.3s ease;
    user-select: none;
}
a.page-link:hover, a.page-link:focus {
    background: linear-gradient(90deg, #ff5599, #ff3366);
    box-shadow: 0 8px 18px rgba(255, 85, 153, 0.4);
    transform: scale(1.05);
    outline: none;
}
@media (max-width: 480px) {
    h1 { font-size: 1.6em; }
    a.page-link { font-size: 1.1em; padding: 12px 16px; }
}

/* ====== Notes buttons ====== */
.notes-page .small-button {
    width: auto;           /* НЕ заема цялата ширина */
    min-width: 140px;      /* минимум ширина */
    max-width: 180px;      /* максимум ширина */
    padding: 14px 28px;
    border-radius: 25px;
    background: rgba(255,255,255,0.9);
    color: #b3002d;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    text-align: center;
}

.notes-page .small-button:hover {
    background: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
}

.notes-page .buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;   /* позволява да паднат на нов ред */
    gap: 15px;
    margin-top: 20px;
}

/* На малки екрани (до 480px) – бутоните един под друг */
@media (max-width: 480px) {
    .notes-page .buttons {
        flex-direction: column;
        align-items: center;
    }
    .notes-page .buttons a {
        width: 100%;
        max-width: 240px; /* за да не са прекалено широки */
    }
}
.notes-page .buttons a {
    white-space: nowrap; /* не позволява пренасяне */
}
