* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Navigation */
.navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #667eea;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#username-display {
    font-weight: 600;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Forms */
#auth-form input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-logout {
    background: #f56565;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Main Content */
#main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.drop-zone.dragover {
    border-color: #667eea;
    background: #f7fafc;
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    fill: #cbd5e0;
    margin-bottom: 1rem;
}

.drop-zone.dragover .upload-icon {
    fill: #667eea;
}

/* Upload Preview */
.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.preview-item {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery */
.gallery-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
}

.gallery-section h2 {
    margin-bottom: 1rem;
    color: #333;
}

.filter-controls {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item.selected {
    box-shadow: 0 0 0 3px #667eea;
    transform: scale(0.95);
}

.photo-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(245, 101, 101, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.photo-item:hover .photo-delete {
    opacity: 1;
}

.photo-delete:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 0.5rem;
    font-size: 0.85rem;
}

/* Config Page */
.config-container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.config-container h2 {
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-group input[type="range"] {
    width: 70%;
    margin-right: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #718096;
    font-size: 0.875rem;
}

.sync-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.sync-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

.sync-info p {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.sync-info span {
    font-weight: 600;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: space-between;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .upload-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}