/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8em;
    display: inline-block;
}

header nav {
    float: right;
    margin-top: 8px;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
}

header nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content */
main {
    padding: 40px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #27ae60;
}

.btn-primary:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

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

/* Category Filter */
.category-filter {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 10px 20px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
    font-size: 0.95em;
}

.category-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.category-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.item-overlay {
    padding: 15px;
}

.item-overlay h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #2c3e50;
}

.item-overlay p {
    font-size: 0.9em;
    color: #7f8c8d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #7f8c8d;
}

/* 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);
}

.modal-content {
    position: relative;
    margin: 2% auto;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.close:hover {
    color: #3498db;
}

.viewer-header {
    padding: 20px 30px;
    background: #2c3e50;
    color: white;
}

.viewer-header h2 {
    margin-bottom: 5px;
}

.viewer-header p {
    color: #bdc3c7;
    font-size: 0.95em;
}

#panorama {
    flex: 1;
    width: 100%;
}

.viewer-controls {
    padding: 20px;
    background: #2c3e50;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.viewer-controls button {
    padding: 12px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.viewer-controls button:hover {
    background: #2980b9;
}

/* Admin Styles */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

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

.admin-card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.admin-card h3 {
    margin: 20px 0 10px;
    color: #34495e;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}

.form-group input[type="file"] {
    padding: 8px;
}

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

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px;
    background: #ecf0f1;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-list li a {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9em;
}

.category-list li a:hover {
    text-decoration: underline;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.login-box h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

/* Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.error-message ul {
    margin-left: 20px;
    margin-top: 10px;
}

/* Image Management */
.image-management {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manage-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

.manage-preview {
    background: #000;
}

.manage-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manage-details {
    padding: 20px;
}

.edit-form .form-group {
    margin-bottom: 15px;
}

.manage-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.3em;
    }
    
    header nav {
        float: none;
        margin-top: 10px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .manage-item {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .viewer-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .category-filter {
        padding: 15px;
    }
    
    .category-btn {
        width: 100%;
        text-align: center;
    }
}
