/* Reza Bildearkiv - Styling */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: #1a1a2e;
    color: white;
    padding: 20px 30px;
    border-bottom: 4px solid #e94560;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 28px;
}

.header p {
    margin: 5px 0 0;
    opacity: 0.9;
}

.nav {
    background: #0f3460;
    padding: 15px 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav a:hover, .nav a.active {
    background: #e94560;
}

.content {
    padding: 30px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.filter-bar select, .filter-bar input {
    width: auto;
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.filter-bar button {
    padding: 10px 20px;
    background: #0f3460;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-bar button:hover {
    background: #e94560;
}

/* Gallery grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.image-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-info {
    padding: 15px;
}

.image-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: #1a1a2e;
}

.image-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
}

.image-meta {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
}

.image-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.image-actions button {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.empty-gallery {
    text-align: center;
    padding: 50px;
    color: #999;
}

/* Video-specific styling */
.video-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-container video {
    width: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: white;
    opacity: 0.8;
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
    pointer-events: none;
    transition: opacity 0.3s;
}

.video-container:hover .video-overlay {
    opacity: 1;
}

.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.media-type-icon {
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #e94560;
}

.modal-info {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 10px;
}

/* Forms and sections */
.upload-section, .edit-section, .password-section, .stats-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #0f3460;
}

.upload-section h2, .edit-section h2, .password-section h2, .stats-section h2 {
    margin-top: 0;
    color: #1a1a2e;
    font-size: 22px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

input[type="file"] {
    padding: 8px;
}

button {
    background: #e94560;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

button:hover {
    background: #c72a48;
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #a71d2a;
}

.edit-btn {
    background: #28a745;
}

.edit-btn:hover {
    background: #218838;
}

.update-btn {
    background: #007bff;
}

.update-btn:hover {
    background: #0056b3;
}

.logout-btn {
    background: #6c757d;
}

.logout-btn:hover {
    background: #5a6268;
}

/* Login container */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 100%;
}

.login-container h2 {
    color: #1a1a2e;
    margin-top: 0;
    text-align: center;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.info {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #e94560;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
}