/* ==========================================================================
   IBO MANAGE MASTER STYLES - FULL VERSION (315+ LINES)
   Dashboard, Stats, Ads-Management, Edit-Form, Add-Form & Preview
   ========================================================================== */

/* --- 1. GLOBALE VARIABLEN & THEMING --- */
:root {
    /* Light Mode Farben */
    --ibo-bg: #f8fafc;
    --ibo-card-bg: #ffffff;
    --ibo-border: #e2e8f0;
    --ibo-text-main: #1e293b;
    --ibo-text-muted: #64748b;
    --ibo-primary: #3b82f6;
    --ibo-primary-hover: #2563eb;
    --ibo-success: #10b981;
    --ibo-danger: #ef4444;
    --ibo-warning: #f59e0b;
    --ibo-input-bg: #ffffff;
    --ibo-shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --ibo-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --ibo-shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

/* --- 2. DARK MODE LOGIK (AUTO & MANUELL) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --ibo-bg: #0b1120;
        --ibo-card-bg: #1e293b;
        --ibo-border: #334155;
        --ibo-text-main: #f1f5f9;
        --ibo-text-muted: #94a3b8;
        --ibo-input-bg: #0f172a;
        --ibo-shadow: 0 4px 12px rgba(0,0,0,0.2);
        --ibo-shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
    }
}

body.dark, body.dark-mode, [data-theme="dark"] {
    --ibo-bg: #0b1120 !important;
    --ibo-card-bg: #1e293b !important;
    --ibo-border: #334155 !important;
    --ibo-text-main: #f1f5f9 !important;
    --ibo-text-muted: #94a3b8 !important;
    --ibo-input-bg: #0f172a !important;
}

/* --- 3. BASIS LAYOUT --- */
body {
    background-color: var(--ibo-bg);
    color: var(--ibo-text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    transition: background 0.3s ease;
}

.ibo-manage-container, 
.edit-container, 
.ibo-add-wrapper {
    max-width: 1240px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.edit-container {
    max-width: 900px;
    margin-top: 20px;
}

/* --- 4. DASHBOARD STATS GRID --- */
.ibo-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ibo-stat-card {
    background: var(--ibo-card-bg);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--ibo-border);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--ibo-shadow);
    transition: transform 0.2s ease;
}

.ibo-stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.ibo-icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--ibo-primary); }
.ibo-icon-gold { background: rgba(245, 158, 11, 0.1); color: var(--ibo-warning); }

.ibo-stat-content { display: flex; flex-direction: column; }
.ibo-stat-label { font-size: 13px; color: var(--ibo-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ibo-stat-value { font-size: 24px; font-weight: 800; color: var(--ibo-text-main); }

/* --- 5. HEADER & ACTIONS --- */
.ibo-manage-header, .flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.ibo-manage-title { font-size: 28px; margin: 0; font-weight: 800; letter-spacing: -0.5px; }
.ibo-manage-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }

.ibo-limit-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ibo-card-bg);
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--ibo-border);
    box-shadow: var(--ibo-shadow-sm);
}

.ibo-limit-filter label { font-size: 13px; color: var(--ibo-text-muted); font-weight: 600; }
.ibo-limit-filter select { border: none; background: none; font-weight: 700; color: var(--ibo-text-main); cursor: pointer; outline: none; font-size: 14px; }

.ibo-btn-primary {
    background: var(--ibo-primary);
    color: white !important;
    padding: 14px 26px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border: none;
}

.ibo-btn-primary:hover { transform: translateY(-1px); background: var(--ibo-primary-hover); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35); }

/* --- 6. AD CARDS LIST (MANAGEMENT) --- */
.ibo-ads-list { display: flex; flex-direction: column; gap: 20px; }

.ibo-ad-card {
    background: var(--ibo-card-bg);
    border-radius: 18px;
    border: 1px solid var(--ibo-border);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--ibo-shadow-lg);
    gap: 20px;
}

.ibo-ad-card:hover { transform: translateY(-3px); border-color: var(--ibo-primary); }

.ibo-ad-image {
    width: 120px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--ibo-border);
}

.ibo-ad-image img { width: 100%; height: 100%; object-fit: cover; }

.ibo-image-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 800; text-transform: uppercase;
    background: rgba(15, 23, 42, 0.6); opacity: 0; transition: 0.3s;
}
.ibo-ad-card:hover .ibo-image-overlay { opacity: 1; }

.ibo-ad-main { flex: 1; min-width: 0; }
.ibo-cat-name { font-size: 11px; font-weight: 800; color: var(--ibo-primary); text-transform: uppercase; letter-spacing: 1px; }
.ibo-ad-title {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important; /* Maximale Zeilen */
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        
        /* Diese Werte sorgen für die exakte Höhe von 2 Reihen */
        line-height: 1.4em !important;
        height: 2.8em !important; 
        min-height: 2.8em !important;
        
        /* Verhindert, dass der Titel die Box sprengt 
        word-break: break-word !important;
        white-space: normal !important;*/
    }
.ibo-ad-info-row { display: flex; gap: 20px; align-items: center; margin-top: 10px; color: var(--ibo-text-muted); font-size: 14px; }
.ibo-price { font-weight: 800; color: var(--ibo-text-main); font-size: 16px; }

/* --- 7. ACTION BUTTONS (RECHTS) --- */
.ibo-ad-buttons { display: flex; flex-direction: column; gap: 8px; }

.ibo-btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: 0.2s;
    text-decoration: none;
    font-size: 15px;
    border: 1px solid transparent;
}

.ibo-btn-edit { background: #1e293b; color: #fff; border-color: #334155; }
.ibo-btn-delete { background: #450a0a; color: #f87171; border-color: #7f1d1d; }
.ibo-btn-refresh { background: #10b981; color: #fff; }
.ibo-btn-icon:hover { transform: scale(1.1); filter: brightness(1.2); }

/* --- 8. BADGES & STATUS --- */
.ibo-badge { font-size: 10px; padding: 3px 10px; border-radius: 6px; font-weight: 800; color: white; text-transform: uppercase; }
.badge-pending { background: var(--ibo-primary); }
.badge-expired { background: var(--ibo-danger); }
.badge-warning { background: var(--ibo-warning); }

/* --- 9. FORMULAR STYLES (EDIT & ADD) --- */
.ibo-main-card, .edit-card, .ibo-form-card {
    background: var(--ibo-card-bg);
    border-radius: 20px;
    border: 1px solid var(--ibo-border);
    padding: 35px;
    box-shadow: var(--ibo-shadow-lg);
}

.form-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 25px; }
.form-group { flex: 1; min-width: 250px; }

.ibo-label { display: block; font-weight: 700; margin-bottom: 10px; color: var(--ibo-text-main); font-size: 14px; }

.ibo-input, .input-style, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--ibo-border);
    border-radius: 10px;
    background: var(--ibo-input-bg);
    color: var(--ibo-text-main);
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.ibo-input:focus { border-color: var(--ibo-primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

.location-box {
    background: rgba(59, 130, 246, 0.04);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--ibo-border);
    margin-bottom: 30px;
}

/* --- 10. IMAGE UPLOAD & SORTING --- */
.ibo-upload-box {
    margin-bottom: 35px;
    background: var(--ibo-bg);
    padding: 40px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--ibo-primary);
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}
.ibo-upload-box:hover { background: rgba(59, 130, 246, 0.05); }

.sortable-item, .image-item {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--ibo-border);
}

.delete-image-ajax {
    position: absolute; top: -6px; right: -6px;
    background: var(--ibo-danger); color: white;
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--ibo-card-bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* --- 11. LIVE VORSCHAU --- */
.ibo-add-grid { display: flex; gap: 35px; flex-wrap: wrap; align-items: flex-start; }
.ibo-form-col { flex: 1.3; min-width: 350px; }
.ibo-preview-col { flex: 0.7; min-width: 300px; position: sticky; top: 30px; }

.ibo-preview-card {
    background: var(--card-bg); /* Nutzt die Variable für Dark/Light */
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: auto; /* WICHTIG: Keine feste Höhe, damit Text Platz hat */
    min-height: 400px;
}
.ibo-preview-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Bild füllt den Kasten ohne Verzerrung */
}
.ibo-preview-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ibo-preview-img-box {
    width: 100%;
    height: 220px; /* Etwas kleiner für bessere Proportionen */
    background: #000; /* Schwarzer Hintergrund für Bilder-Platzhalter */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ibo-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(59, 130, 246, 0.05); /* Dezenter Hintergrund */
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 10px 0;
}
#prev_desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line; /* Behält Zeilenumbrüche bei */
    overflow: hidden;
}
/* --- 12. RESPONSIVE DESIGN (BREAKPOINTS) --- */
@media (max-width: 1024px) {
    .ibo-preview-col { position: static; width: 100%; order: 2; }
    .ibo-form-col { width: 100%; flex: none; order: 1; }
}

@media (max-width: 768px) {
    .ibo-manage-header { flex-direction: column; align-items: flex-start; gap: 25px; }
    .ibo-manage-actions { width: 100%; justify-content: space-between; }
    
    .ibo-ads-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .ibo-ad-card {
        flex-direction: column;
        padding: 15px;
        align-items: flex-start;
        text-align: left;
    }

    .ibo-ad-image { width: 100%; height: 130px; margin-bottom: 10px; }
    .ibo-ad-main { padding: 0; width: 100%; }
    .ibo-ad-title { font-size: 15px; white-space: normal; height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .ibo-ad-info-row { flex-direction: column; align-items: flex-start; gap: 5px; }
    
    .ibo-ad-buttons { flex-direction: row; width: 100%; justify-content: space-between; margin-top: 15px; }
    .ibo-btn-icon { flex: 1; height: 42px; }
    
    .ibo-main-card { padding: 25px 20px; }
}

@media (max-width: 480px) {
    .ibo-ads-list { grid-template-columns: 1fr; }
    .ibo-stat-card { flex-direction: column; text-align: center; padding: 20px; }
    .ibo-manage-title { font-size: 22px; }
    .ibo-btn-primary { width: 100%; justify-content: center; }
}
.section-title {color: var(--text-main); font-size: 1.1rem; height: 40px; overflow: hidden;
}
/* --- 13. UTILS & ANIMATION --- */
.pointer { cursor: pointer; }
.text-inherit { color: inherit; }
.ms-2 { margin-left: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }

.alert { padding: 20px; border-radius: 12px; margin-bottom: 25px; border: 1px solid transparent; display: flex; align-items: center; gap: 12px; }
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ibo-ad-card { animation: fadeIn 0.4s ease forwards; }
/* --- CHECKOUT SPECIFIC STYLES --- */
.ibo-checkout-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 700px;
    margin: 60px auto;
}

.ibo-checkout-icon {
    width: 70px;
    height: 70px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 30px;
}

.ibo-price-display {
    background: var(--bg-color);
    border: 1px solid var(--primary);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 35px;
}

.ibo-bank-details {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    font-size: 14px;
    color: var(--text-muted);
}

.ibo-bank-data-box {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 10px 0;
    line-height: 1.6;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .ibo-checkout-card {
        padding: 25px 20px;
        margin: 30px auto;
    }
    .ibo-price-display {
        padding: 15px;
    }
}
/* --- CONTACT PAGE SPECIFIC STYLES --- */
.ibo-contact-wrapper {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg);
}

.ibo-contact-sidebar {
    flex: 1;
    background: var(--primary);
    color: white;
    padding: 40px;
    min-width: 300px;
}

.ibo-contact-sidebar h3 {
    margin-top: 0;
    color: white;
}

.ibo-contact-form-area {
    flex: 2;
    padding: 40px;
    min-width: 350px;
    background: var(--card-bg);
}

.ibo-contact-info-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ibo-contact-info-list span {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .ibo-contact-sidebar, .ibo-contact-form-area {
        padding: 30px 20px;
    }
    .ibo-manage-title {
        font-size: 24px;
    }
}/* --- CONTACT PAGE SPECIFIC STYLES --- */
.ibo-contact-wrapper {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg);
}

.ibo-contact-sidebar {
    flex: 1;
    background: var(--primary);
    color: white;
    padding: 40px;
    min-width: 300px;
}

.ibo-contact-sidebar h3 {
    margin-top: 0;
    color: white;
}

.ibo-contact-form-area {
    flex: 2;
    padding: 40px;
    min-width: 350px;
    background: var(--card-bg);
}

.ibo-contact-info-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ibo-contact-info-list span {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .ibo-contact-sidebar, .ibo-contact-form-area {
        padding: 30px 20px;
    }
    .ibo-manage-title {
        font-size: 24px;
    }
}
/* --- STATIC PAGES SPECIFIC STYLES --- */
.ibo-page-wrapper {
    max-width: 800px;
    margin: 40px auto 60px;
    padding: 0 20px;
    min-height: 500px;
}

.ibo-page-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.ibo-page-title {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    font-weight: 800;
}

.ibo-page-content {
    line-height: 1.8;
    color: var(--text-main); /* Wichtig für Dark Mode Sichtbarkeit */
    font-size: 16px;
}

/* Verhindert, dass Bilder in Inhaltsseiten das Layout sprengen */
.ibo-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .ibo-page-wrapper { margin: 20px auto; }
    .ibo-page-card { padding: 25px 20px; }
    .ibo-page-title { font-size: 24px; }
}
/* Äußerer Container */
.ibo-related-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Überschrift mit Border */
.ibo-related-heading {
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 800;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.ibo-related-heading i {
    margin-right: 10px;
    color: var(--primary);
}

/* Das Grid */
.ibo-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

/* Die Karte */
.ibo-sim-card {
    display: block; /* Wichtig für den Link */
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ibo-sim-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

/* Bild-Container */
.ibo-sim-img-container {
    height: 180px;
    background: var(--bg-body);
    overflow: hidden;
}

.ibo-sim-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Füllt den Raum aus, schneidet ggf. Ränder ab */
    transition: transform 0.5s ease;
}

.ibo-sim-card:hover .ibo-sim-img-container img {
    transform: scale(1.05); /* Leichter Zoom beim Hover */
}

/* Info-Bereich */
.ibo-sim-info {
    padding: 15px;
}

.ibo-sim-title {
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    height: 2.8em; /* Entspricht ca. 2 Zeilen */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Schneidet Text nach 2 Zeilen mit "..." ab */
    -webkit-box-orient: vertical;
}

.ibo-sim-price {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}
/* Spezifischer Wrapper für "Kürzlich angesehen" */
.ibo-recent-wrapper {
    max-width: 1200px;
    margin: 60px auto 40px; /* Mehr Abstand nach oben zur Abgrenzung */
    padding: 0 20px;
}

/* Gemeinsame Überschriften-Klasse (falls noch nicht global definiert) */
.ibo-section-heading {
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 800;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ibo-section-heading i {
    color: var(--primary);
}

/* Nutze die Stile von .ibo-sim-card aus dem vorherigen Post */
.btn-buy {
    background-color: #28a745; /* Ein schönes Grün */
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

/* Anpassung für den Dark Mode via Attribut */
[data-theme='dark'] .btn-buy {
    background-color: #218838;
    color: #e0e0e0;
}