/*
 * style.css - Bildergallery Design (ABZ / UDE Style)
 */

:root {
    --primary: #003b7a; /* UDE-Blau */
    --secondary: #002b5a; /* Dunklere UDE-Sekundärfarbe */
    --gradient: linear-gradient(135deg, #003b7a 0%, #002b5a 100%);
    --white: #ffffff;
    --gray-light: #f1f3f9;
    --gray: #d1d8e5;
    --gray-text: #767676;
    --text: #333;
    --ude-blue: #003b7a;
    --success: #10b981;
    --error: #ef4444;
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', 'Open Sans', sans-serif;
    background-color: #f8f9fa;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Barrierefreiheit: Fokus-Stile für Tastatur-Navigation */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Screenreader-only Klassen */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Branding Header */
.branding-header {
    background: white;
    padding: 20px 2rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.branding-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ude-logo img { height: 45px; width: auto; }
.abz-logo img { height: 40px; width: auto; }

/* Navbar */
.navbar {
    background: var(--ude-blue);
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    height: 60px;
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 12px;
    height: 60px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 40px;
}

h1 {
    font-weight: 600;
    font-size: 1.8rem;
    margin: 0 0 1.5rem 0;
    color: var(--primary);
}

h2 {
    font-weight: 600;
    color: var(--primary);
    margin: 2rem 0 1rem 0;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d8e5;
    border-radius: 0;
    font-size: 16px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: var(--primary);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem 1.5rem;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 59, 122, 0.3);
}

.btn-primary {
    background: var(--gradient);
}

.btn-secondary {
    background: #334155;
}

.btn-danger {
    background: #ef4444;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

.error {
    background-color: #fee;
    color: var(--error);
    padding: 15px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.success {
    background-color: #efe;
    color: var(--success);
    padding: 15px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 1px solid #cfc;
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.user-info {
    color: var(--text);
}

.actions {
    margin-bottom: 30px;
}

.galleries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-card {
    background-color: white;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

.gallery-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-card h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.gallery-card p {
    margin-bottom: 15px;
    color: #666;
}

.gallery-actions {
    display: flex;
    gap: 10px;
}

.gallery-actions .btn {
    flex: 1;
    text-align: center;
}

/* Upload Section */
.upload-section,
.uploaded-images,
.embed-link,
.embed-options,
.embed-code,
.preview,
.direct-link {
    margin: 30px 0;
}

.upload-section {
    border: 2px dashed #d1d8e5;
    background: #f8f9ff;
    padding: 3rem;
    text-align: center;
}

.upload-section h2 {
    margin-top: 0;
    color: var(--primary);
}

.embed-options form {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.embed-options label {
    margin-bottom: 0;
}

.embed-options input {
    width: 120px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #d1d8e5;
    border-radius: 0;
    background-color: #f9f9f9;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
}

.preview-container {
    border: 1px solid #d1d8e5;
    padding: 20px;
    margin-top: 20px;
    border-radius: 0;
    background-color: white;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    border: 1px solid #eee;
    padding: 10px;
    background: white;
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
}

.image-item form {
    margin-top: 10px;
}

.image-item .btn {
    width: 100%;
    padding: 8px;
    font-size: 14px;
}

.info {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid var(--primary);
    margin-top: 30px;
}

.info h2 {
    margin-top: 0;
    color: var(--primary);
}

.info ul {
    padding-left: 20px;
}

.info li {
    margin-bottom: 10px;
    color: #666;
}

/* User Management Styles */
.form-section {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.users-table {
    margin-top: 30px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-admin {
    background: #ef4444;
    color: white;
}

.badge-bereich {
    background: #f59e0b;
    color: white;
}

.badge-nutzer {
    background: #10b981;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Footer */
.main-footer {
    background: white;
    border-top: 1px solid #eee;
    padding: 40px 2rem;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 600;
}

/* Responsivität */
@media (max-width: 900px) {
    .container {
        padding: 20px;
    }

    .branding-header {
        padding: 15px 1rem;
    }

    .ude-logo img, .abz-logo img {
        max-height: 40px;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .galleries {
        grid-template-columns: 1fr;
    }

    .gallery-actions {
        flex-direction: column;
    }

    .embed-options form {
        flex-direction: column;
        align-items: stretch;
    }

    .embed-options input {
        width: 100%;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th, .data-table td {
        padding: 8px;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .user-info {
        margin-top: 10px;
    }
}

form {
    margin-bottom: 0;
}

/* Einbettungscode */
.embed-code-container {
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-left: 3px solid var(--primary);
}

.embed-code-container h4 {
    margin-top: 0;
    color: var(--primary);
}

.embed-code {
    font-family: monospace;
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    border-radius: 0;
    padding: 10px;
    white-space: pre-wrap;
    word-break: break-all;
    tab-size: 2;
}

.btn-copy {
    background: var(--gray-text) !important;
    margin-top: 5px !important;
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
}

.btn-copy:hover {
    background: var(--primary) !important;
}