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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Header */
header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 16px;
    font-weight: bold;
    color: #764ba2;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* Info Box */
.info-box {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-box p {
    color: #666;
    font-size: 16px;
}

/* Tab Bar */
.tab-bar {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    flex: 1 1 auto;
    min-width: 80px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #764ba2;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    background: white;
    transform: translateY(-1px);
}

.tab.active {
    background: #764ba2;
    color: white;
    border-color: #764ba2;
    box-shadow: 0 3px 10px rgba(118, 75, 162, 0.4);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.empty-state span {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
}

/* Gallery Grid */
#galleryGrid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Painting Card */
.gallery-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.painting-number {
    font-size: 16px;
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 10px;
}

.painting-title {
    font-size: 14px;
    font-weight: normal;
    color: #666;
}

.painting-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f0f0f0;
    cursor: pointer;
    transition: transform 0.2s;
}

.painting-image:hover {
    transform: scale(1.02);
}

/* Zoom-Icon auf Bildern */
.gallery-card {
    position: relative;
}

.gallery-card::after {
    content: "🔍";
    position: absolute;
    top: 45px;
    right: 22px;
    font-size: 20px;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

.gallery-card:hover::after {
    opacity: 0.9;
}

.painting-dimensions {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    text-align: center;
}

/* Like Section */
.like-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.like-button {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-button:hover {
    border-color: #764ba2;
    transform: scale(1.05);
}

.like-button.liked {
    background: #764ba2;
    border-color: #764ba2;
    color: white;
}

.like-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-count {
    font-size: 16px;
    color: #666;
    font-weight: bold;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 24px;
}

/* Error Message */
.error {
    background: #e74c3c;
    color: white;
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 14px;
    }
    
    .header-content {
        max-width: 100%;
    }
    
    #galleryGrid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

/* Fullscreen Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(110, 110, 110, 0.97);
    cursor: pointer;
    animation: fadeIn 0.2s;
}

.image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.disabled-like {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Login / Logout Links im Header */
.login-link {
    margin-left: 8px;
    font-size: 14px;
    color: #764ba2;
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

/* Login Modal */
.login-modal {
    display: none;
    position: fixed;
    z-index: 2500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s;
}

.login-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px 25px 25px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-modal-content h2 {
    color: #764ba2;
    font-size: 22px;
    margin-bottom: 12px;
}

.login-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.login-modal-close:hover {
    color: #764ba2;
}

.login-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.4;
}

#loginForm label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin: 10px 0 4px;
}

#loginForm input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
}

#loginForm input:focus {
    outline: none;
    border-color: #764ba2;
}

.login-submit {
    width: 100%;
    margin-top: 16px;
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-submit:hover {
    background: #5a3881;
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-status {
    margin-top: 14px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    line-height: 1.3;
}

.login-status[data-type="error"] {
    color: #c0392b;
}

.login-status[data-type="success"] {
    color: #27ae60;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}