@import './side-tabs.css';

/**
 * Detail-Layout: Einheitlicher Container für "eine Karte + Side-Tabs (Rail)".
 * Wird auf Profil-Seiten, Itinerary-Detail und (mit Modifier) pro Blog-Card in Listen genutzt.
 * Side-Tabs positionieren sich relativ zu diesem Container (position: relative).
 */

.detail-layout {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    position: relative;
    min-height:500px;
    overflow: visible;
    z-index: 10;
}

/**
 * Gemeinsamer Bezug für Karte + Rail: `left: 100%` auf `.side-tabs` bezieht sich
 * auf diese Box (Kartenbreite), nicht auf `.detail-layout`.
 */
 .detail-with-rail {
    position: relative;
    /* Einziges Flex-Item unter .detail-layout: gleiche Fläche wie zuvor Karte+Rail-Setup */
}

.modal-with-rail {
    position: relative;
    /* Einziges Flex-Item unter .detail-layout: gleiche Fläche wie zuvor Karte+Rail-Setup */
}

.detail-layout--itinerary {
    max-width: 1400px;
}

/* Modifier für Listen-Kontext: z.B. jede Blog-Card in .item-cards (kein eigener Rand, volle Breite) */
.detail-layout--item {
    max-width: none;
    margin: 0;
    min-height: 0;
}

/*
 * Inhaltskarte:
 * Gleiche visuelle Card-Basis wie `.item-card` (Position, Größe, Radius, Schatten),
 * damit Listen- und Detailansichten konsistent wirken.
 */
.detail-card {
    flex: 1;
    width: auto;
    min-width: 960px;
    max-width: 960px;
    min-height: 100%;
    max-height: 100%;
    border: var(--card-border);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: var(--card-padding);
    margin-left: var(--card-list-indent);
    position: relative;
    background-color: var(--surface-color);
    z-index: 10;
}

.detail-card--vortex {
    min-height: 250px;
}

.itinerary-detail-card {
    max-width: 1400px;
    padding: 0.5rem;
    z-index: 10;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    padding-bottom: 1rem;
    gap: 2rem;
    justify-content: center;
}

.detail-logo {
    display: flex;
    align-items: center;
}

.detail-symbol {
    font-size: 4rem;
    line-height: 1;
}

.detail-title {
    font-size: 1.8rem;
    color: var(--text-body);
    margin: 0;
    align-self: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.detail-content {
    display: grid;
    grid-template-areas:
    "header header"
    "sidebar main";
    gap: var(--spacing-md);
}
.detail-content__sidebar { 
    grid-area: sidebar; 
    min-width: 300px;
    max-width: 300px;
}
.detail-content__main { grid-area: main; }

/* Section helpers */
.section-title {
    margin-top: 1rem;
    font-size: 1.5rem;
    color: var(--text-body);
    grid-column: span 2;
}

.section-info {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-body-light);
    font-size: 0.95rem;
    text-align: left;
}

.section-info--centered {
    text-align: center;
}

.section-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.section-list__item {
    display: flex;
    flex-direction: row;
    
    width: 100%;
    align-items: center;
    gap: 10px;
}

/* Rollen in der kombinierten Kontaktliste (Freund / Fediverse …) */
.contacts-role-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--tag-color);
    color: inherit;
}

/* Fediverse-User-Suche (WebFinger) */
.fediverse-search {
    grid-column: span 2;
    margin-bottom: 1rem;
}

.fediverse-search__row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.fediverse-search__input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 1rem;
}

.fediverse-search-result {
    grid-column: span 2;
    margin-top: 1rem;
}

.fediverse-search-result__loading {
    color: var(--text-body-light);
}

.fediverse-search-result__error {
    color: var(--debug-todo, #c62828);
}

.fediverse-search-result__card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.1rem;
    background: var(--background-color-medium, #f5f5f5);
    border-radius: 8px;
}

.fediverse-search-result__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.fediverse-search-result__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    font-size: 1.5rem;
}

.fediverse-search-result__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fediverse-search-result__name {
    font-size: 1rem;
}

.fediverse-search-result__handle {
    font-size: 0.85rem;
    color: var(--text-body-light);
}

.fediverse-search-result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}



.fediverse-search-result__follow--done {
    opacity: 0.85;
    cursor: default;
}

/* Media uploader (generic) */
.media-uploader {
    text-align: center;
}

.media-uploader__frame {
    /* container for image, reserved for future styling */
}

.media-uploader__image,
.media-uploader__current-image {
    width: 250px;
    height: 320px;
    object-fit: cover;
    border-radius: 5px;
}

.media-uploader__input {
    display: none;
}

.media-uploader__dropzone,
.media-uploader__placeholder {
    width: 250px;
    height: 320px;
    margin: 0 auto 20px;
}

.media-uploader__dropzone {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-uploader__dropzone--active {
    border-color: #4a90e2;
    background-color: var(--dropdown-zone-valid-transparent);
}

.media-uploader__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color-medium);
}

.media-uploader__icon {
    font-size: 50px;
    color: var(--text-body-light);
}

.media-uploader__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color-dark-transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-uploader__dropzone:hover .media-uploader__overlay {
    opacity: 1;
    border: 3px dashed #ccc;
}

.media-uploader__text {
    color: var(--text-body-white);
    text-align: center;
    font-size: 14px;
    padding: 10px;
}

.media-uploader__text i {
    font-size: 24px;
    margin-bottom: 5px;
}

.media-uploader__subtext {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

.media-uploader__form { display: none; }

.media-uploader__progress {
    width: 150px;
    height: 10px;
    background-color: var(--background-color-medium);
    border-radius: 5px;
    margin: 10px auto;
    overflow: hidden;
    position: relative;
}

.media-uploader__progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
}

.media-uploader__progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--text-body-white);
}

/* Identity signature (kept for passport-like visual) */
.identity-signature__text {
    font-family: cursive;
    font-size: 2.5rem;
    color: var(--text-body-light);
    margin-bottom: 0.5rem;
}

.identity-signature__line {
    border: none;
    border-bottom: 1px solid #999;
}

/* Export area */
.export__description { grid-column: span 2; }
.export__container {
    grid-column: span 2;
    position: relative;
    margin-bottom: 2rem;
}
.export__data {
    width: 100%;
    height: 500px;
    background-color: var(--background-color-medium);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    overflow: auto;
    font-family: monospace;
    white-space: pre-wrap;
    margin-top: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    grid-column: span 2;
}

.alert--error {
    background-color: var(--debug-todo);
    border-left: 4px solid #f44336;
    color: var(--text-body);
}

.alert--success {
    background-color: var(--success-color);
    border-left: 4px solid #2e7d32;
    color: var(--text-body);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {
    .detail-layout {
        flex-direction: column;
        min-height: auto;
        margin: 0.0rem;
    }

    .detail-layout--item {
        margin: 0;
    }

    .detail-card {
        margin: 0.0rem;
        padding: 0.5rem;
        min-width: 0;
        max-width: 100%;

    }

    .detail-content {
        display: flex;
        flex-direction: column;
    }
    
    .detail-symbol {
        font-size: 2.5rem;
    }
    .detail-title {
        font-size: 1.0rem;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        max-width: 80%;

    }

    .media-uploader__frame {
        width: 150px;
        height: 200px;
    }

    .media-uploader__image {
        width: 140px;
        height: 180px;
    }

    .export__data { height: 300px; }
}


