/*
 * Custom Layout CSS - Ersatz für AdminLTE3
 * Bootstrap 5 kompatibel
 */

/* ========== h_da Corporate Identity Font ========== */
@font-face {
    font-family: 'HDA DIN';
    src: url('/static/bot/fonts/HDADINOff.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'HDA DIN';
    src: url('/static/bot/fonts/HDADINOffBld.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'HDA DIN';
    src: url('/static/bot/fonts/HDADINOffMed.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* ========== Variables ========== */
:root {
    --sidebar-width: 250px;
    --header-height: 57px;
    --footer-height: 50px;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* ========== Links ========== */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* ========== Base Layout ========== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'HDA DIN', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-color: #f4f6f9;
}

/* ========== Wrapper ========== */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== Main Header / Navbar ========== */
.main-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #fff;
    z-index: 1030;
}

.main-header.navbar {
    padding: 0.5rem 1rem;
}

.main-header .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.main-header .brand-image {
    max-height: 33px;
    width: auto;
    margin-right: 0.5rem;
}

.main-header .brand-text {
    font-size: 1.25rem;
    font-weight: 300;
}

/* ========== Content Wrapper ========== */
.content-wrapper {
    flex: 1;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    background-color: #f4f6f9;
}

.layout-top-nav .content-wrapper {
    margin-left: 0;
}

/* ========== Content Header ========== */
.content-header {
    padding: 15px 0.5rem;
}

.content-header h1 {
    font-size: 1.8rem;
    margin: 0;
}

/* ========== Content ========== */
.content {
    padding: 0 0.5rem;
}

/* ========== Main Footer ========== */
.main-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    color: #869099;
    font-size: 0.875rem;
}

/* ========== Cards ========== */
.card {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1rem;
    border: 0;
    border-radius: 0.25rem;
}

.card-outline {
    border-top: 3px solid;
}

.card-outline.card-primary {
    border-top-color: var(--primary-color);
}

.card-outline.card-success {
    border-top-color: var(--success-color);
}

.card-outline.card-warning {
    border-top-color: var(--warning-color);
}

.card-outline.card-danger {
    border-top-color: var(--danger-color);
}

.card-outline.card-info {
    border-top-color: var(--info-color);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

/* ========== Elevation (Shadow) ========== */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23);
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0,0,0,.19), 0 6px 6px rgba(0,0,0,.23);
}

.elevation-4 {
    box-shadow: 0 14px 28px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.22);
}

/* ========== Info Box ========== */
.info-box {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    border-radius: 0.25rem;
    background-color: #fff;
    display: flex;
    margin-bottom: 1rem;
    min-height: 80px;
    padding: 0.5rem;
    position: relative;
}

.info-box .info-box-icon {
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.875rem;
    width: 70px;
}

.info-box .info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;
    flex: 1;
}

.info-box .info-box-text {
    font-size: 0.875rem;
    text-transform: uppercase;
}

.info-box .info-box-number {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ========== Small Box ========== */
.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    display: block;
    margin-bottom: 20px;
    position: relative;
}

.small-box .inner {
    padding: 10px;
}

.small-box .inner h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
    white-space: nowrap;
}

.small-box .inner p {
    font-size: 1rem;
    margin: 0;
}

.small-box .icon {
    color: rgba(0,0,0,.15);
    z-index: 0;
}

.small-box .icon > i {
    font-size: 90px;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: transform .3s linear;
}

.small-box > .small-box-footer {
    background-color: rgba(0,0,0,.1);
    color: rgba(255,255,255,.8);
    display: block;
    padding: 3px 0;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 10;
}

/* ========== Background Colors ========== */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.bg-dark {
    background-color: var(--dark-color) !important;
}

.bg-lightblue {
    background-color: #3c8dbc !important;
}

.bg-navy {
    background-color: #001f3f !important;
}

.bg-teal {
    background-color: #39cccc !important;
}

.bg-olive {
    background-color: #3d9970 !important;
}

.bg-lime {
    background-color: #01ff70 !important;
}

.bg-orange {
    background-color: #ff851b !important;
}

.bg-fuchsia {
    background-color: #f012be !important;
}

.bg-purple {
    background-color: #605ca8 !important;
}

.bg-maroon {
    background-color: #d81b60 !important;
}

.bg-gray {
    background-color: #adb5bd !important;
}

.bg-gray-dark {
    background-color: #343a40 !important;
}

/* ========== Text Colors ========== */
.text-sm {
    font-size: 0.875rem !important;
}

.text-lg {
    font-size: 1.25rem !important;
}

.text-xl {
    font-size: 1.5rem !important;
}

/* ========== Login Page ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    width: 360px;
    max-width: 95%;
}

.login-box .card {
    margin-bottom: 0;
}

/* ========== Tables ========== */
.table-responsive {
    overflow-x: auto;
}

/* ========== Utility Classes ========== */
.h-100 {
    height: 100% !important;
}

.linklike {
    cursor: pointer;
}

.linklike:hover {
    text-decoration: underline;
}

/* ========== Typing Animation ========== */
.typing {
    position: relative;
}

.typing span {
    content: '';
    animation: blink 1.5s infinite;
    animation-fill-mode: both;
    height: 5px;
    width: 5px;
    background: #000000;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 40%;
}

.typing span:nth-child(2) {
    animation-delay: .2s;
    margin-left: 9px;
}

.typing span:nth-child(3) {
    animation-delay: .4s;
    margin-left: 18px;
}

@keyframes blink {
    0% {
        opacity: .1;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: .1;
    }
}

/* ========== Responsive ========== */
@media (max-width: 767.98px) {
    .content-header h1 {
        font-size: 1.5rem;
    }

    .small-box .inner h3 {
        font-size: 1.5rem;
    }

    .small-box .icon > i {
        font-size: 60px;
    }
}

/* ========== Select2 Bootstrap 5 Theme Overrides ========== */
.select2-container--bootstrap4 .select2-selection {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ========== Inline Edit ========== */
.inline-editable {
    cursor: pointer !important;
    transition: all 0.15s;
    border-bottom: 1px solid transparent;
    display: inline;
}

.inline-editable:hover {
    border-bottom: 1px dashed #aaa !important;
}

.inline-editable.editing {
    display: block;
    border-bottom: none !important;
}

.inline-edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: inherit;
    font-family: inherit;
    resize: vertical;
    background: #fff;
}

.inline-edit-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.inline-edit-actions {
    margin-top: 4px;
    display: flex;
    gap: 4px;
}

.inline-edit-actions button {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
}

.inline-edit-actions .inline-edit-save {
    background: #007bff;
    color: #fff;
    border: none;
}

.inline-edit-actions .inline-edit-save:hover {
    background: #0056b3;
}

.inline-edit-actions .inline-edit-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.inline-edit-actions .inline-edit-cancel:hover {
    background: #f5f5f5;
    color: #333;
}

/* ========== Chatbot Button ========== */
.chatbot-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #9DC41E 0%, #719E3E 100%);
    color: white !important;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(157, 196, 30, 0.4);
    font-weight: 500;
    font-size: 0.875rem;
}

.chatbot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 196, 30, 0.5);
    background: linear-gradient(135deg, #aed42e 0%, #82af4e 100%);
    color: white !important;
}

.chatbot-btn i {
    font-size: 1.25rem;
}

/* Mobile header layout */
@media (max-width: 767.98px) {
    .main-header .container-fluid {
        flex-wrap: nowrap;
        align-items: center;
    }

    .main-header .navbar-brand {
        flex: 0 1 auto;
        margin-right: 0.5rem;
    }

    .main-header .navbar-brand .brand-text {
        display: none;
    }

    .main-header .chatbot-btn {
        flex: 0 1 auto;
        margin-left: 0 !important;
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    .main-header .chatbot-btn span {
        display: none;
    }

    .main-header .navbar-toggler {
        margin-left: auto !important;
    }
}
