* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
body { font-family: -apple-system, Segoe UI, Roboto, sans-serif; background: #0b0d12; color: #e6e6e6; display: flex; flex-direction: column; min-height: 100vh; }

.topnav { display: flex; align-items: center; justify-content: space-between; background: #171a21; padding: 14px 24px; }
.logo { color: #4da3ff; font-weight: 700; font-size: 20px; text-decoration: none; }
nav a { color: #ccc; margin-left: 18px; text-decoration: none; font-size: 14px; }
nav a:hover { color: #4da3ff; }
.burger { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; flex: 1 0 auto; width: 100%; }
.view-page, main { flex: 1 0 auto; }

.auth-box, .card { background: #171a21; padding: 24px; border-radius: 10px; max-width: 420px; margin: 0 auto 20px; }
.auth-box input, .card input { display: block; width: 100%; padding: 10px; margin: 8px 0; border-radius: 6px; border: 1px solid #333; background: #0f1115; color: #fff; }
button, .btn-secondary { padding: 10px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
button[type=submit] { background: #4da3ff; color: #fff; margin-top: 8px; width: 100%; }
.btn-secondary { background: #333; color: #fff; width: 100%; }
.btn-danger { background: #4da3ff; color: #fff; width: 100%; margin-top: 16px; padding: 12px; font-size: 15px; border: none; border-radius: 6px; cursor: pointer; }
.alert { color: #ff8080; margin-bottom: 10px; }
.alert-success { color: #6fcf97; margin-bottom: 10px; }

.upload-box { max-width: 600px; margin: 0 auto; position: relative; z-index: 1; }
#drop-zone { border: 2px dashed #444; border-radius: 10px; padding: 60px 20px; text-align: center; cursor: pointer; transition: 0.2s; position: relative; z-index: 1; pointer-events: auto; }
#drop-zone.dragover { border-color: #4da3ff; background: #1c2230; }
#drop-zone p { pointer-events: none; }
#progress-wrap { background: #222; border-radius: 6px; margin-top: 16px; height: 10px; overflow: hidden; }
#progress-bar { background: #4da3ff; height: 100%; width: 0%; transition: width 0.2s; }
#result { margin-top: 20px; max-width: 600px; margin-left: auto; margin-right: auto; }
#result .preview-img { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto 20px; }
#result .field-label { font-weight: 700; text-align: center; margin: 16px 0 8px; font-size: 15px; }
#result input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #2a2e38; background: #0d1420; color: #dbe4ff; text-align: center; font-size: 13px; }

.gallery-header { margin-bottom: 20px; }
.gallery-header h2 { margin-bottom: 14px; }
.gallery-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-tab { background: #171a21; color: #aab4c8; padding: 8px 16px; border-radius: 20px; text-decoration: none; font-size: 13px; border: 1px solid #262b36; transition: 0.15s; }
.filter-tab:hover { border-color: #4da3ff; color: #fff; }
.filter-tab.active { background: #4da3ff; color: #fff; border-color: #4da3ff; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 18px; }
.gallery-item { background: #12151c; border-radius: 12px; overflow: hidden; border: 1px solid #1e222c; transition: transform 0.15s, box-shadow 0.15s; }
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.gallery-thumb-link { position: relative; display: block; }
.gallery-item img { width: 100%; height: 170px; object-fit: cover; display: block; }
.badge { position: absolute; top: 8px; left: 8px; font-size: 11px; padding: 4px 9px; border-radius: 12px; font-weight: 600; color: #fff; z-index: 2; }
.badge-site { background: #4da3ff; }
.badge-ext { background: #f5a623; }
.badge-app { background: #9b59f6; }
.badge-guest { background: #6b7280; }
.gallery-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 4px; font-size: 12px; color: #8a94a6; }
.gallery-actions { display: flex; gap: 8px; padding: 10px 12px 14px; }
.btn-copy { flex: 1; background: #1d2330; color: #cfe0ff; border: 1px solid #2a3448; padding: 8px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.btn-copy:hover { background: #26304a; }
.btn-danger-sm { flex: 1; background: #3a1a1e; color: #ff8f92; border: 1px solid #522126; padding: 8px; border-radius: 6px; font-size: 12px; text-align: center; text-decoration: none; }
.btn-danger-sm:hover { background: #4a2126; }
.empty-msg { color: #8a94a6; padding: 30px 0; }

.view-page { display: flex; justify-content: center; padding: 10px 0; }
.view-card { background: #12151c; border: 1px solid #1e222c; border-radius: 16px; overflow: hidden; max-width: 780px; width: 100%; display: grid; grid-template-columns: 1fr; }
.view-image-wrap { position: relative; background: #000; display: flex; align-items: center; justify-content: center; max-height: 500px; overflow: hidden; }
.view-image { width: 100%; max-height: 500px; object-fit: contain; display: block; }
.view-info { padding: 24px; }
.view-info-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.view-stat { font-size: 13px; color: #8a94a6; display: flex; align-items: center; gap: 4px; }
.view-stat-icon { font-size: 14px; }
.view-filename { font-size: 20px; margin-bottom: 6px; color: #fff; word-break: break-word; }
.view-meta { font-size: 13px; color: #8a94a6; margin-bottom: 20px; }
.view-links { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.link-group label { font-size: 12px; color: #8a94a6; margin-bottom: 4px; display: block; font-weight: 600; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2e38; background: #0d1420; color: #dbe4ff; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-copy-inline { flex-shrink: 0; background: #1d2330; color: #cfe0ff; border: 1px solid #2a3448; padding: 10px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; width: auto; }
.btn-copy-inline:hover { background: #26304a; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-view-action { flex: 1; text-align: center; padding: 12px; border-radius: 8px; font-size: 14px; text-decoration: none; min-width: 140px; }
.btn-view-primary { background: #4da3ff; color: #fff; }
.btn-view-primary:hover { background: #3d8fe0; }
.btn-view-secondary { background: #1c2230; color: #cfd6e4; border: 1px solid #2a3448; }
.btn-view-secondary:hover { background: #262e42; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 20px; }
.account-grid .card { max-width: none; margin: 0; }
#api-key-field { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid #1e222c; }
.admin-tab { color: #8a94a6; text-decoration: none; padding: 10px 18px; font-size: 14px; border-bottom: 2px solid transparent; }
.admin-tab.active { color: #4da3ff; border-bottom-color: #4da3ff; }
.admin-tab:hover { color: #fff; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { background: linear-gradient(145deg, #171a21, #12151c); border: 1px solid #1e222c; border-radius: 12px; padding: 20px; text-align: center; }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; color: #fff; }
.stat-label { font-size: 12px; color: #8a94a6; margin-top: 4px; }

.section-title { font-size: 16px; margin: 24px 0 12px; color: #cfd6e4; }

.source-bars { background: #12151c; border: 1px solid #1e222c; border-radius: 10px; padding: 18px; margin-bottom: 10px; }
.source-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.source-bar-label { width: 100px; font-size: 13px; color: #aab4c8; }
.source-bar-track { flex: 1; background: #1c2028; border-radius: 6px; height: 10px; overflow: hidden; }
.source-bar-fill { height: 100%; border-radius: 6px; }
.fill-site { background: #4da3ff; }
.fill-ext { background: #f5a623; }
.fill-app { background: #9b59f6; }
.fill-guest { background: #6b7280; }
.source-bar-count { width: 30px; text-align: right; font-size: 13px; color: #cfd6e4; }

.admin-search { display: flex; gap: 10px; margin-bottom: 18px; max-width: 420px; }
.admin-search input { flex: 1; padding: 10px; border-radius: 6px; border: 1px solid #262b36; background: #12151c; color: #fff; }
.admin-search button { background: #4da3ff; color: #fff; border-radius: 6px; padding: 10px 16px; width: auto; }

.role-tag, .status-tag { font-size: 11px; padding: 3px 9px; border-radius: 10px; font-weight: 600; }
.role-admin { background: #2a1c40; color: #c9a6ff; }
.role-user { background: #1c2230; color: #8a94a6; }
.status-active { background: #142b1c; color: #6fcf97; }
.status-banned { background: #3a1a1e; color: #ff8f92; }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-mini { font-size: 11px; padding: 6px 10px; border-radius: 5px; border: none; cursor: pointer; width: auto; }
.btn-mini-danger { background: #3a1a1e; color: #ff8f92; }
.btn-mini-secondary { background: #1c2230; color: #cfd6e4; }
.empty-cell { text-align: center; color: #8a94a6; padding: 20px !important; }

.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; font-size: 14px; background: #12151c; border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { border-bottom: 1px solid #1e222c; padding: 10px 12px; text-align: left; }
.admin-table th { background: #171a21; color: #8a94a6; font-size: 12px; text-transform: uppercase; }
.admin-table tr:hover td { background: #151922; }

/* ==== Sticky footer ==== */
.site-footer-main {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    background: #12151c;
    border-top: 1px solid #1e222c;
    padding: 28px 24px;
    margin-top: 40px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.footer-brand .footer-logo { color: #4da3ff; font-weight: 700; font-size: 17px; }
.footer-brand .footer-tagline { color: #8a94a6; font-size: 13px; margin-top: 4px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-nav a { color: #cfd6e4; text-decoration: none; font-size: 14px; }
.footer-nav a:hover { color: #4da3ff; }
.footer-copy { color: #8a94a6; font-size: 13px; text-align: right; line-height: 1.5; }

/* ==== Info stranice (FAQ, Terms, Privacy, Download) ==== */
.info-page { max-width: 820px; margin: 0 auto; }
.info-page h1 { font-size: 28px; margin-bottom: 8px; color: #fff; }
.info-page .info-subtitle { color: #8a94a6; font-size: 14px; margin-bottom: 30px; }
.info-page h2 { font-size: 18px; color: #4da3ff; margin: 30px 0 10px; }
.info-page p { color: #cfd6e4; line-height: 1.7; margin-bottom: 12px; font-size: 14px; }
.info-page ul { color: #cfd6e4; line-height: 1.7; margin: 0 0 16px 20px; font-size: 14px; }

.faq-item { background: #12151c; border: 1px solid #1e222c; border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.faq-answer { padding: 0 20px; color: #8a94a6; font-size: 14px; line-height: 1.6; max-height: 0; overflow: hidden; transition: 0.25s; }
.faq-item.open .faq-answer { padding: 0 20px 18px; max-height: 500px; }
.faq-toggle-icon { transition: 0.25s; color: #4da3ff; }
.faq-item.open .faq-toggle-icon { transform: rotate(45deg); }

.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 20px; margin-top: 24px; }
.download-card { background: #12151c; border: 1px solid #1e222c; border-radius: 14px; padding: 28px 24px; text-align: center; }
.download-icon { font-size: 40px; margin-bottom: 14px; }
.download-card h3 { color: #fff; font-size: 18px; margin-bottom: 8px; }
.download-card p { color: #8a94a6; font-size: 13px; margin-bottom: 20px; min-height: 40px; }
.download-btn { display: inline-block; background: #4da3ff; color: #fff; padding: 12px 26px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; }
.download-btn:hover { background: #3d8fe0; }
.download-meta { color: #5c6577; font-size: 12px; margin-top: 12px; }

.site-footer { text-align: center; padding: 20px; color: #666; font-size: 13px; }

@media (max-width: 768px) {
    .burger { display: block; }
    #navmenu { display: none; flex-direction: column; position: absolute; top: 56px; right: 0; background: #171a21; width: 200px; padding: 10px 0; }
    #navmenu.open { display: flex; }
    #navmenu a { margin: 10px 16px; }
    .container { padding: 0 12px; margin: 16px auto; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
    .gallery-item img { height: 130px; }
    .admin-table { font-size: 12px; overflow-x: auto; display: block; white-space: nowrap; }
    #drop-zone { padding: 40px 12px; }
    .gallery-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .admin-tabs { overflow-x: auto; }
    .view-info { padding: 16px; }
    .view-actions { flex-direction: column; }
    .footer-inner { flex-direction: column; text-align: left; }
    .footer-copy { text-align: left; }
    .footer-nav { gap: 16px; }
}
