/* Import Assistant Font */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@200;300;400;500;600;700;800&family=Droid+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --color-bg: #F0F0ED;          /* R240 G240 B237 */
  --color-surface: #FFFFFF;      /* clean white cards/sections */
  --color-text: #000000;         /* black text for readability */
  --color-brand: #C02C30;        /* R192 G44 B48 - red only for branding */
  --color-muted: #EDEDEA;        /* subtle borders/fills */
  --color-primary: #FFFFFF;      /* primary buttons light */
  --color-primary-contrast: #000000; /* black text on primary */
  --color-accent: #F0F0ED;       /* light gray accents */
  --color-accent-contrast: #000000;  
  --overlay-hover: rgba(0,0,0,0.05);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Assistant', sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
  background: var(--color-surface);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-height: 60px;
    padding: 5px 0;
}

.brand:hover {
    transform: translateY(-1px);
}

.logo-container {
    display: flex;
    align-items: center;
    width: 50px;
    height: 50px;
}

.logo {
    height: 50px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.logo-fallback {
    width: 50px;
    height: 50px;
    background: var(--color-brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.logo-text {
    color: white;
    font-weight: bold;
    font-size: 18px;
    font-family: 'Droid Serif', serif;
}

.logo-fallback:hover {
    transform: scale(1.05);
    background: #a02327;
}

/* Fallback wenn Logo nicht lädt */
.logo[alt]:before {
    content: attr(alt);
    display: inline-block;
    background: var(--color-brand);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
}

.brand-text h1 {
    font-family: 'Droid Serif', serif;
    font-size: 2rem;
    font-weight: 400;
    margin: 0;
    color: var(--color-text);
}

.brand-text span {
    font-family: 'Droid Serif', serif;
    font-size: 0.9rem;
    opacity: 0.9;
    color: #b07b35;
}

.nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--color-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Assistant', sans-serif;
    font-weight: 500;
}

.nav a:hover {
    background: var(--overlay-hover);
    color: var(--color-text);
}

/* Main Content */
main {
    min-height: 70vh;
    padding: 2rem 0;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in;
    padding: 3rem 0;
}

.section.active {
    display: block;
}

.section > h2 {
    text-align: center;
    margin: 0 0 3rem 0;
    color: var(--color-text);
    font-family: 'Droid Serif', serif;
    font-weight: 400;
    font-size: 3rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--color-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-surface);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(189, 195, 199, 0.3);
    margin: 2rem 0;
}

.hero h2 {
    font-family: 'Droid Serif', serif;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    font-weight: 400;
}

.hero p {
    font-family: 'Assistant', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding: 0 1rem;
}

/* Hide CTA buttons when logged in */
body.logged-in .cta-buttons { display: none !important; }
body.logged-in #homeSignupBtn, body.logged-in #homeLoginBtn { display: none !important; }

/* Profile */
.profile-card { background: var(--color-surface); padding:2rem; border-radius:16px; box-shadow:0 4px 18px rgba(0,0,0,0.08); max-width:600px; margin:0 auto; }
.profile-card h3 { margin:1.5rem 0 0.75rem; font-family:'Droid Serif',serif; }
.profile-card input { width:100%; padding:0.75rem 1rem; margin:0.4rem 0; border:1px solid var(--color-muted); border-radius:10px; font-family:'Assistant',sans-serif; }
.profile-card button { margin-top:0.6rem; }
.profile-info p { margin:0.3rem 0; }
.password-update { margin-top:1rem; }

/* Buttons */
.btn {
    padding: 12px 26px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Assistant', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

.btn.primary {
    background: rgb(253,209,35);
    color: var(--color-text);
}

.btn.primary:hover {
    background: rgb(226,191,16);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226,191,16,0.3);
}

.btn.secondary {
    background: rgb(253,209,35);
    color: var(--color-text);
}

.btn.secondary:hover {
    background: rgb(226,191,16);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226,191,16,0.3);
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid #e1e1de;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.15);
    backdrop-filter: blur(10px);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text);
    font-family: 'Droid Serif', serif;
    font-weight: 400;
    font-size: 2.5rem;
}

.form-container p {
    margin-top: 2rem; /* Mehr Abstand für "No account yet?" Text */
    text-align: center;
    color: var(--color-text);
    font-family: 'Assistant', sans-serif;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    font-family: 'Assistant', sans-serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Assistant', sans-serif;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-text);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgb(253,209,35); /* Gelb statt rot */
    box-shadow: 0 0 0 3px rgba(253,209,35,0.25);
}

/* Gallery */
.gallery-controls {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls label {
    font-weight: 500;
    color: var(--color-text);
}

.pagination-controls select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--color-surface);
    color: var(--color-text);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination button {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    border-color: rgba(253,209,35,0.5);
    background: rgba(253,209,35,0.1);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 500;
    color: var(--color-text);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid #e1e1de;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.image-card:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.08);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-card .image-info {
    padding: 15px;
}

.image-card .image-title {
    font-family: 'Assistant', sans-serif;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
}

.image-card .image-keywords {
    font-family: 'Assistant', sans-serif;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 10px;
}

.image-card .image-folder {
    font-family: 'Assistant', sans-serif;
    font-size: 0.8rem;
    color: var(--color-text);
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #e74c3c;
    background: white;
}

/* Admin */
.admin-controls {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-list {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.admin-item {
    display: grid;
    grid-template-columns: 1fr 2fr 3fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.admin-item:last-child {
    border-bottom: none;
}

.admin-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-item input[type="text"] {
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    width: 100%;
}

.admin-item .save-btn {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-item .save-btn:hover {
    background: #218838;
}

/* Legal Content */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    line-height: 1.6;
}

.legal-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--color-muted);
    padding-bottom: 0.5rem;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
    color: var(--color-text);
}

.legal-content ul {
    margin: 1rem 0 1.5rem 0;
    padding-left: 2rem;
    list-style-type: disc;
}

.legal-content li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: var(--color-text);
    padding-left: 0.5rem;
}

.legal-content li strong {
    font-weight: 600;
    color: var(--color-text);
}

.legal-content ul ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style-type: circle;
}

.legal-content ul ul li {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: linear-gradient(90deg, rgb(226,191,16) 0%, rgb(253,209,35) 100%); 
    color: var(--color-text); /* black text in footer */
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    font-family: 'Assistant', sans-serif;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-content span {
    font-weight: 500;
}

.footer-content a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.footer-content a:hover {
    opacity: 0.7;
}

.footer-divider {
    color: var(--color-text);
    opacity: 0.6;
    font-weight: 300;
}

/* Flash Messages */
.flash-message {
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: 500;
}

.flash-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-message.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #9fcdff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-container {
        width: 40px;
        height: 40px;
    }
    
    .logo {
        height: 40px;
        max-width: 100px;
    }
    
    .logo-fallback {
        width: 40px;
        height: 40px;
    }
    
    .brand-text h1 {
        font-size: 1.6rem;
    }

    .nav {
        justify-content: center;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .section > h2 {
        font-size: 2.2rem;
        margin-bottom: 2rem;
        padding-bottom: 0.5rem;
    }

    .section {
        padding: 2rem 0;
    }

    .search-bar {
        flex-direction: column;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .admin-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 11px 22px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo-container {
        width: 35px;
        height: 35px;
    }
    
    .logo {
        height: 35px;
        max-width: 80px;
    }
    
    .logo-fallback {
        width: 35px;
        height: 35px;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    .brand-text h1 {
        font-size: 1.4rem;
    }
    
    .brand {
        gap: 0.5rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
