/* =================================================================
   FreizeitPLAN - components.css
   ================================================================= */

/* -----------------------------------------------------------------
   1. Logo & Brand (Header)
   ----------------------------------------------------------------- */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo img {
    height: 48px;
    width: auto;
    background: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: height 0.2s ease;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
}

.brand-title span {
    color: var(--brand-turquoise);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* Mobiles Ausblenden von Titel & Untertitel im Hochformat */
@media (max-width: 640px) {
    .brand-title,
    .brand-subtitle {
        display: none !important;
    }
    .brand-logo img {
        height: 38px;
    }
}

/* -----------------------------------------------------------------
   2. Buttons
   ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    cursor: pointer;
    border: none;
}

.btn-turquoise {
    background-color: var(--brand-turquoise);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 168, 181, 0.2);
}

.btn-turquoise:hover {
    background-color: var(--brand-turquoise-hover);
}

.btn-accent {
    background-color: var(--brand-accent);
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-accent:hover {
    background-color: var(--brand-accent-hover);
}

.btn-dark {
    background-color: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    border: 1px solid #334155;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-dark:hover {
    background-color: #334155;
}

.btn-card {
    background-color: var(--brand-default);
    color: white;
    font-size: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
}

.btn-card:hover {
    background-color: var(--brand-dark);
}

/* -----------------------------------------------------------------
   3. Cards & Containers
   ----------------------------------------------------------------- */
.card {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* -----------------------------------------------------------------
   4. Badges, Tags & Admin Icon
   ----------------------------------------------------------------- */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background-color: rgba(255, 183, 3, 0.2);
    color: #78350f;
}

.badge-member {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.badge-admin-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.15), rgba(255, 183, 3, 0.3));
    color: #854d0e;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-admin-icon svg {
    width: 0.875rem;
    height: 0.875rem;
    fill: currentColor;
}

/* -----------------------------------------------------------------
   5. Grid Layouts
   ----------------------------------------------------------------- */
.grid-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* -----------------------------------------------------------------
   6. Tenant Tabs (Reiter)
   ----------------------------------------------------------------- */
.tenant-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.tenant-tab {
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    transition: all 0.2s;
}

.tenant-tab.active {
    background-color: var(--brand-dark);
    color: white;
    border-color: var(--brand-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tenant-tab:hover:not(.active) {
    background-color: #f1f5f9;
}

/* -----------------------------------------------------------------
   7. Mandanten-Select Dropdown (Responsive & Overflow-Schutz)
   ----------------------------------------------------------------- */
.tenant-select-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 640px) {
    .tenant-select-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1.25rem;
    }
}

.tenant-select-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-dark);
    white-space: nowrap;
}

.tenant-select {
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-dark);
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    text-overflow: ellipsis;
}

.tenant-select:hover {
    border-color: var(--brand-turquoise);
}

.tenant-select:focus {
    outline: none;
    border-color: var(--brand-turquoise);
    box-shadow: 0 0 0 3px rgba(0, 168, 181, 0.15);
}

/* -----------------------------------------------------------------
   8. Formulare & Moderne Inputs
   ----------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    background-color: white;
    color: var(--text-main);
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-turquoise);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 168, 181, 0.12);
}

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* -----------------------------------------------------------------
   9. Alerts & Nachrichten
   ----------------------------------------------------------------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

/* -----------------------------------------------------------------
   10. Legal / Text Pages
   ----------------------------------------------------------------- */
.legal-container {
    max-width: 48rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 0.75rem;
}

.legal-text {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-main);
}

.legal-text-muted {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.text-link {
    color: var(--brand-turquoise);
    text-decoration: underline;
}

.legal-list {
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
    color: var(--text-main);
    line-height: 1.6;
}

.legal-list li {
    margin-bottom: 0.375rem;
}

.legal-list li::marker {
    color: var(--brand-turquoise);
}

/* -----------------------------------------------------------------
   11. Mobile Optimierungen für Formulare, Cards & Headers
   ----------------------------------------------------------------- */

/* Responsive 2-Spalten Grid für Formulare (schaltet auf Mobile auf 1 Spalte um) */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Card-Header Optimierung für Mobile (stapelt Elemente untereinander statt erzwungenem Neben- und Überlappen) */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
    .card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1.5rem;
    }
}

/* Projekt-Card Header & Meta Infos */
.project-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 480px) {
    .project-card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}