/* ES24 Dashboard Responsive CSS */
/* Center Theme Default Page Title on Händlerportal & Dashboard Pages */
.page .entry-title,
.page .post-title,
.page .page-title,
.page h1,
h1.entry-title,
.wp-block-post-title {
    text-align: center !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 20px !important;
}

.es24-dashboard-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 650px;
    box-sizing: border-box !important;
}

.es24-dashboard-standalone-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.es24-dash-sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    background: #0f172a;
    padding: 20px 0;
    box-sizing: border-box;
}

.es24-dash-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.es24-dash-sidebar li {
    margin: 0;
    padding: 0;
}

.es24-dash-sidebar li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    text-decoration: none;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.es24-dash-sidebar li a:hover,
.es24-dash-sidebar li a.active {
    background: #1e293b;
    color: #ffffff;
    border-left-color: #38bdf8;
}

.es24-dash-content {
    flex: 1;
    min-width: 0; /* CRITICAL for Flexbox child overflow handling */
    padding: 25px;
    position: relative;
    overflow-x: auto; /* Ensures smooth horizontal scroll if container is narrow */
    box-sizing: border-box;
}

.es24-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

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

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

/* Responsive Table Wrapper */
.es24-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.es24-table-responsive table {
    width: 100%;
    min-width: 680px; /* Ensures table headers don't squish unreadably */
    border-collapse: collapse;
}

.es24-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.es24-form-col label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    margin-top: 15px;
    color: #333;
}

.es24-form-col input[type="text"],
.es24-form-col input[type="number"],
.es24-form-col select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.es24-form-col input[type="color"] {
    height: 40px;
    border: none;
    padding: 0;
    cursor: pointer;
}

.es24-logo-preview {
    margin-bottom: 10px;
    min-height: 50px;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.es24-list-item {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.es24-list-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #222;
}

.es24-list-item p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.es24-btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* DASHBOARD TILES OVERVIEW STYLES */
.es24-tiles-container {
    width: 100%;
    margin: 0 auto 30px auto;
}

.es24-dashboard-tile {
    position: relative;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    padding: 16px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    box-sizing: border-box;
}

.es24-dashboard-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.3);
}

.es24-tile-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.32);
    padding: 16px;
    border-radius: 10px;
    backdrop-filter: blur(2px);
    box-sizing: border-box;
}

.es24-tile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.es24-tile-icon {
    font-size: 26px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 10px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.es24-tile-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.es24-tile-desc {
    margin: 8px 0 16px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #ffffff !important;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
    flex-grow: 1;
}

.es24-tile-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(6px);
    width: fit-content;
    transition: all 0.2s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.es24-dashboard-tile:hover .es24-tile-action {
    background: #ffffff;
    color: #1a237e;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-shadow: none;
}

/* Mobile & Tablet Responsive Layout */
@media (max-width: 900px) {
    .es24-dashboard-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .es24-dash-sidebar {
        width: 100%;
        border-radius: 8px 8px 0 0;
        padding: 10px 0;
    }

    .es24-dash-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .es24-dash-sidebar li {
        flex: 1 1 auto;
        text-align: center;
    }

    .es24-dash-sidebar li a {
        padding: 10px 12px;
        font-size: 13px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .es24-dash-sidebar li a:hover,
    .es24-dash-sidebar li a.active {
        border-left-color: transparent;
        border-bottom-color: #ffd700;
    }

    .es24-dash-content {
        padding: 15px;
    }
}

/* ENFORCE WHITE TEXT & HIGH CONTRAST ON ALL COLORED BUTTONS */
#es24-back-to-projects,
#es24-send-email-confirm-btn,
#es24-send-email-modal-btn,
#es24-generate-project-pdf,
#es24-sign-digital-btn,
#es24-create-invoice-btn,
#es24-gen-invoice-pdf-btn,
#es24-save-sign-pdf-btn,
#es24-add-custom-tpl-btn,
#es24-scan-bill-btn,
#es24-ai-tab-gen-text-btn,
#es24-ai-tab-scan-btn,
.es24-btn-open-rooms,
.es24-btn-open-offer-pdf,
.es24-ai-gen-btn,
.button-primary {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* ES24 Schulungs-Akademie Video Cards (Mit Video-Agentin Susanne) */
.es24-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.es24-video-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.es24-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.es24-video-thumb-wrap {
    position: relative;
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.es24-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
}

.es24-video-card:hover .es24-video-overlay {
    background: rgba(15, 23, 42, 0.25);
}

.es24-play-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1a237e;
    font-size: 20px;
    padding-left: 3px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.es24-video-card:hover .es24-play-icon {
    transform: scale(1.15);
    background: #ffffff;
    color: #0d47a1;
}

.es24-susanne-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #7b1fa2, #4a148c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.es24-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
