/* ========================================
   ADMIN PANEL - Style dla panelu administratora
   ======================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   LOGOWANIE
   ======================================== */

.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #234F60 0%, #121111 100%);
    padding: 20px;
}

.admin-login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.admin-login-box h1 {
    color: #234F60;
    margin-bottom: 10px;
    font-size: 1.8rem;
    text-align: center;
}

.login-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #234F60;
    box-shadow: 0 0 0 3px rgba(35, 79, 96, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #234F60;
    box-shadow: 0 0 0 3px rgba(35, 79, 96, 0.1);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ========================================
   PRZYCISKI
   ======================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #234F60;
    color: white;
}

.btn-primary:hover {
    background: #1a3d4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 79, 96, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ========================================
   LAYOUT — SIDEBAR + CONTENT
   ======================================== */

body {
    min-height: 100vh;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1a3340;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    user-select: none;
}

.sidebar-brand span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    margin-top: 3px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

.nav-item i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.nav-separator {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 8px 16px;
}

.nav-item.nav-logout {
    margin-top: auto;
    color: rgba(255,255,255,0.4);
}

.nav-item.nav-logout:hover {
    color: #ff6b6b;
    background: rgba(255,100,100,0.08);
}

/* --- Content area --- */
.admin-content {
    margin-left: 220px;
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
    background: #f5f5f5;
    min-height: 100vh;
}

/* --- Page title --- */
.page-title {
    color: #234F60;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Legacy selectors — zachowane dla kompatybilności z resztą kodu */
.admin-container {
    /* nie używane w nowym layoucie, zachowane dla starych fragmentów */
}

.admin-header {
    display: none; /* górny pasek usunięty */
}

.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-nav-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.admin-nav-btn:hover {
    border-color: #234F60;
    color: #234F60;
}

.admin-nav-btn.active {
    background: #234F60;
    color: white;
    border-color: #234F60;
}

.admin-main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: #234F60;
    font-size: 1.5rem;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.dashboard-card {
    display: block;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 32px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    text-align: center;
}

.dashboard-card:hover {
    border-color: #234F60;
    box-shadow: 0 4px 16px rgba(35, 79, 96, 0.15);
    transform: translateY(-3px);
}

.dashboard-card-icon {
    font-size: 2.5rem;
    color: #234F60;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    color: #234F60;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.dashboard-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    color: #234F60;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-content form {
    padding: 30px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ========================================
   RESPONSYWNOŚĆ
   ======================================== */

@media (max-width: 900px) {
    .admin-sidebar {
        width: 64px;
    }
    .sidebar-brand span,
    .nav-item span.nav-label {
        display: none;
    }
    .sidebar-brand {
        padding: 24px 0;
        text-align: center;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    .nav-item {
        padding: 14px 0;
        justify-content: center;
        gap: 0;
    }
    .nav-item i {
        width: auto;
        font-size: 1.1rem;
    }
    .admin-content {
        margin-left: 64px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .modal-content {
        margin: 10px;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   ADMIN LIGHTBOX — pokaz slajdów
   ======================================== */

.admin-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    outline: none;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    flex-shrink: 0;
}

.lb-filename {
    font-size: 0.9rem;
    opacity: 0.85;
}

.lb-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.lb-close:hover { opacity: 1; }

.lb-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    padding: 0 60px;
}

.lb-media {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lb-nav:hover { background: rgba(255,255,255,0.25); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lb-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

