/* static/css/dashboard.css */

/* ── Layout ──────────────────────────────────────────── */
body.bg-dashboard {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 0;
    overflow-y: auto;
}

#dashboard_wrap {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    background: transparent;
    width: 100%;
    max-width: 100%;
    /* Platz für das fixierte Menü */
    margin-top: 50px;
    height: calc(100vh - 50px);
    height: calc(100dvh - 50px);
    overflow: hidden;
}

#dashboard_sidebar {
    width: 160px;
    flex-shrink: 0;
    padding: 1.5rem 0.75rem 0.5rem;
    overflow-y: auto;
    box-sizing: border-box;
}

#dashboard_main {
    flex: 1;
    padding: 2rem 3rem 4rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ── Sidebar nav ─────────────────────────────────────── */
#dashboard_menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#dashboard_menu a {
    display: block;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    letter-spacing: 0.3px;
}

#dashboard_menu a:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-1px);
}

#dashboard_menu a.active {
    color: #00c3ff;
    font-weight: 600;
    border-color: #00c3ff;
    background: rgba(0,195,255,0.08);
}

/* ── Section heading ─────────────────────────────────── */
#applications_heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: .6rem;
}

/* ── Status ──────────────────────────────────────────── */
.dash-status {
    padding: .6rem .9rem;
    border-radius: 6px;
    font-size: .85rem;
    margin-bottom: 1rem;
    color: #ccc;
    background: rgba(255,255,255,0.06);
}
.dash-status[data-type="error"] { background: rgba(220,38,38,0.15); color: #fca5a5; }

.dash-empty {
    color: rgba(255,255,255,0.45);
    font-size: .9rem;
    padding: 1.5rem 0;
}

.dash-archive-info {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .65rem .9rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .82rem;
    line-height: 1.5;
    color: #c4b5a0;
    background: rgba(180,130,60,0.1);
    border: 1px solid rgba(180,130,60,0.2);
}

/* ── Application cards ───────────────────────────────── */
#applications_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.dash-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: .75rem 1rem;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    min-width: 0;
    box-sizing: border-box;
}

.dash-card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.25);
}

.dash-card-sent {
    border-color: rgba(22,163,74,0.4);
    background: rgba(22,163,74,0.05);
}

.dash-card-main {
    flex: 1;
    min-width: 0;
}

.dash-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .3rem;
}

.dash-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
}

/* Status badges */
.dash-status-badge {
    font-size: .7rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    font-weight: 500;
}
.dash-status-draft    { background: rgba(255,255,255,0.1); color: #ccc; }
.dash-status-ready    { background: rgba(59,130,246,0.2);  color: #93c5fd; }
.dash-status-sent     { background: rgba(22,163,74,0.2);   color: #86efac; }
.dash-status-archived { background: rgba(100,100,100,0.2); color: #9ca3af; }

.dash-score {
    font-size: .78rem;
    font-weight: 700;
}

.dash-badge {
    font-size: .67rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    font-weight: 500;
}
.dash-badge-ok         { background: rgba(22,163,74,0.15); color: #86efac; }
.dash-badge-compressed { background: rgba(100,100,100,0.2); color: #9ca3af; }

.dash-date {
    color: rgba(255,255,255,0.35);
    font-size: .75rem;
    margin-left: auto;
}

/* Card action buttons */
.dash-card-actions {
    display: flex;
    gap: .4rem;
    margin-left: .75rem;
    flex-shrink: 0;
}

.dash-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: .2rem .35rem;
    border-radius: 6px;
    opacity: 0.4;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}
.dash-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.dash-btn-pin.pinned { opacity: 1; }
.dash-btn-export { text-decoration: none; display: inline-flex; align-items: center; }

/* Komprimierte / archivierte Bewerbungen */
.dash-card-compressed {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}
.dash-card-compressed:hover {
    background: rgba(255,255,255,0.05);
}
/* Nur den Textbereich ausgrauen, Buttons bleiben sichtbar */
.dash-card-compressed .dash-card-main {
    opacity: 0.45;
}
.dash-card-compressed .dash-btn-export {
    opacity: 0.85;
    font-size: 1.2rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1000px) {

    #dashboard_wrap {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    #dashboard_sidebar {
        width: 100%;
        padding: .75rem 1rem .5rem;
        overflow-y: visible;
    }

    #dashboard_main {
        min-height: unset;
        overflow-y: visible;
        padding: 1.25rem 1rem 4rem;
    }

    @media (orientation: portrait) {
        #dashboard_menu { flex-direction: column; gap: 8px; }
        #dashboard_menu a { font-size: 1rem; padding: 10px 16px; }

        .dash-card { padding: 1rem; }
        .dash-card-title { font-size: 1.05rem; }
        .dash-card-meta { font-size: .9rem; }
        .dash-status-badge { font-size: .8rem; padding: .22rem .6rem; }
        .dash-date { font-size: .82rem; }
        .dash-btn { font-size: 1.3rem; padding: .3rem .5rem; }
        #applications_heading { font-size: 1.25rem; }
        .dash-status { font-size: .95rem; }
    }

    @media (orientation: landscape) {
        #dashboard_menu { flex-direction: row; flex-wrap: wrap; gap: 8px; justify-content: center; }
        #dashboard_menu a { font-size: 1rem; padding: 10px 16px; }

        .dash-card-title { font-size: 1.05rem; }
        .dash-card-meta { font-size: .9rem; }
    }
}
