/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Nagłówek */
header {
    background: linear-gradient(135deg, #0055a4 0%, #003366 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffd700;
}

/* Sekcje */
section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #0055a4;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ffd700;
}

/* Siatki */
.years-grid, .albums-grid, .photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.year-item, .album-item, .photo-item {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.year-item:hover, .album-item:hover, .photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.folder-icon {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
    background: #f8f9fa;
}

.album-item img, .photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.year-item h3, .album-item h3 {
    text-align: center;
    padding: 1rem;
    background: #0055a4;
    color: white;
    margin: 0;
    font-size: 1rem;
}

.album-item h3, .photo-item h3 {
    background: #d52b1e;
}

/* Przyciski */
.btn-back {
    background: #0055a4;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #003366;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
}

.modal-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #ffd700;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* Pusta galeria */
.empty-gallery {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.empty-gallery p {
    font-size: 1.2rem;
    color: #666;
}

.empty-gallery a {
    color: #0055a4;
    text-decoration: none;
    font-weight: 500;
}

.empty-gallery a:hover {
    text-decoration: underline;
}

/* Formularze */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-control:focus {
    border-color: #0055a4;
    outline: none;
}

.btn {
    display: inline-block;
    background: #0055a4;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
    text-decoration: none;
}

.btn:hover {
    background: #003366;
}

.btn-danger {
    background: #d52b1e;
}

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

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

/* Responsywność */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        margin-top: 1rem;
    }
    
    nav a {
        margin: 0 0.5rem;
    }
    
    .years-grid, .albums-grid, .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .nav-btn {
        font-size: 18px;
        padding: 8px 12px;
    }
    
    .close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}

/* Dodatkowe style */
.loading, .empty-message, .error-message {
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.loading {
    color: #0055a4;
}

.empty-message {
    color: #666;
}

.error-message {
    color: #d52b1e;
    background: #ffeaea;
    border-radius: 4px;
}

.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.message.success {
    background: #e8f5e8;
    color: #28a745;
    border: 1px solid #28a745;
}

.message.error {
    background: #ffeaea;
    color: #d52b1e;
    border: 1px solid #d52b1e;
}

.year-management {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.albums-list {
    margin-bottom: 1rem;
}

.album-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #0055a4;
}

.album-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.photo-count {
    color: #666;
    font-size: 0.9rem;
}