/* ═══════════════════════════════════════════════════════════════════════════
   BEWERBUNGSTRACKER COMPONENTS CSS
   Extracted component styles for better modularity and maintainability
   ═════════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin: 0;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card.card-minimal {
    background: transparent;
    border: none;
    padding: 0;
}

.card.card-minimal:hover {
    border-color: transparent;
    box-shadow: none;
}

.card.card-compact {
    padding: 0.75rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   STAT CARDS
   ────────────────────────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.2s;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-card.blue {
    border-left: 3px solid var(--info);
}

.stat-card.green {
    border-left: 3px solid var(--secondary);
}

.stat-card.yellow {
    border-left: 3px solid var(--warning);
}

.stat-card.red {
    border-left: 3px solid var(--danger);
}

.stat-card.purple {
    border-left: 3px solid var(--primary-light);
}

/* ──────────────────────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────────────────────── */

.btn {
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn:active {
    transform: none;
}

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

.btn-secondary {
    background: var(--bg-card2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #1a1a1a;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button-group.button-group-vertical {
    flex-direction: column;
    align-items: flex-start;
}

.button-group.button-group-vertical .btn {
    width: 100%;
    justify-content: center;
}

.button-group.button-group-justified {
    width: 100%;
}

.button-group.button-group-justified .btn {
    flex: 1;
    justify-content: center;
}

/* ──────────────────────────────────────────────────────────────────────────
   FORM ELEMENTS
   ────────────────────────────────────────────────────────────────────────── */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select,
textarea {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--bg-card);
}

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

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────
   MODALS
   ────────────────────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
}

.modal.modal-large {
    max-width: 700px;
}

.modal.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────────
   TABLES
   ────────────────────────────────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    text-align: left;
    padding: 0.65rem 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

tr:hover td {
    background: var(--bg-card2);
}

tr:last-child td {
    border-bottom: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   BADGES & CHIPS
   ────────────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-beworben {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-antwort {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.badge-interview {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.badge-zusage {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-absage {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-ghosting {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.chip {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
    background: transparent;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--text);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ──────────────────────────────────────────────────────────────────────────
   TABS
   ────────────────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* ──────────────────────────────────────────────────────────────────────────
   EMAIL ITEMS
   ────────────────────────────────────────────────────────────────────────── */

.email-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    transition: all 0.2s;
}

.email-item:hover {
    border-color: var(--primary);
    background: var(--bg-card2);
}

.email-item-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.email-firma {
    font-weight: 600;
    font-size: 0.95rem;
}

.email-subject {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   KANBAN
   ────────────────────────────────────────────────────────────────────────── */

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-col {
    min-width: 200px;
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.kanban-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

.kanban-body {
    padding: 0.5rem;
    min-height: 100px;
}

.kanban-card {
    background: var(--bg-card2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.kanban-card:hover {
    border-color: var(--primary);
}

.kanban-firma {
    font-weight: 600;
    font-size: 0.88rem;
}

.kanban-position {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.kanban-days {
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   UTILITIES
   ────────────────────────────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    padding-left: 2.2rem;
}

.search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-section {
    background: var(--bg-card2);
    border-radius: 8px;
    padding: 0.75rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.highlight {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.highlight.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.highlight.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────────────────
   PRIORITY 2 COMPONENTS: Email Item, Stat Card, Tabs, Kanban
   ────────────────────────────────────────────────────────────────────────── */

/* EMAIL ITEM COMPONENT */
.email-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.email-item:hover {
    background: var(--bg-card2);
    border-color: var(--primary);
}

.email-item-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.email-firma {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-light);
}

.email-subject {
    font-weight: 500;
    margin-top: 0.15rem;
    color: var(--text);
}

.email-item-compact {
    background: transparent;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.email-item-compact:hover {
    background: var(--bg-card);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
}

/* STAT CARD COMPONENT */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 120px;
    justify-content: center;
    transition: all 0.2s;
}

.stat-card:hover {
    background: var(--bg-card2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 1.75rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.stat-card.blue { --card-color: #3B82F6; }
.stat-card.blue .stat-value { color: #3B82F6; }

.stat-card.yellow { --card-color: #F59E0B; }
.stat-card.yellow .stat-value { color: #F59E0B; }

.stat-card.purple { --card-color: #8B5CF6; }
.stat-card.purple .stat-value { color: #8B5CF6; }

.stat-card.green { --card-color: #10B981; }
.stat-card.green .stat-value { color: #10B981; }

.stat-card.red { --card-color: #EF4444; }
.stat-card.red .stat-value { color: #EF4444; }

.stat-card-compact {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-card-horizontal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

/* TABS COMPONENT */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
}

.tab:hover {
    color: var(--text);
    background: var(--bg-card);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.tabs-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid var(--border);
    padding-left: 0;
}

.tab-vertical {
    padding: 0.75rem 1.25rem;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.2s;
    margin-left: -1px;
}

.tab-vertical:hover {
    color: var(--text);
    background: var(--bg-card2);
}

.tab-vertical.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--bg-card);
}

/* KANBAN CARD COMPONENT */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.kanban-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.kanban-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: var(--bg-card2);
}

.kanban-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.kanban-card {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.kanban-card:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.kanban-firma {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-light);
    margin-bottom: 0.35rem;
}

.kanban-position {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.kanban-days {
    font-size: 0.75rem;
    font-weight: 500;
}

.kanban-card-with-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.kanban-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.kanban-card-compact {
    background: var(--bg-card2);
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card-compact:hover {
    background: var(--primary);
    color: white;
}

.kanban-firma-compact {
    font-size: 0.8rem;
    font-weight: 600;
}

.kanban-position-compact {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

.kanban-meta {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.2rem;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-body.drag-over {
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

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

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

    .modal {
        max-width: calc(100vw - 2rem);
        padding: 1rem;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .kanban-board {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .kanban-col {
        max-height: 400px;
    }

    .kanban-body {
        max-height: 300px;
    }
}