/* ============================= */
/* ZENTRALE CSS-VARIABLEN        */
/* ============================= */

:root {
    /* Farben - ROWE Corporate Design */
    --primary-color: #2C4F6F;        /* ROWE Dunkelblau */
    --secondary-color: #5B7E9B;      /* ROWE Hellblau */
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #1a3a52;           /* Noch dunkleres Blau für Kontrast */
    --header-bg: #2C4F6F;            /* ROWE Dunkelblau */
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --border-color: #ddd;
    --text-muted: #6b8da8;           /* Abgestimmtes Grau-Blau */

    /* Layout */
    --container-max-width: 1400px;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --padding-section: 20px;
    --margin-section: 20px;

    /* Schriften */
    --font-family: Arial, sans-serif;
    --font-size-base: 14px;
    --font-size-large: 24px;
    --font-size-small: 12px;
    --font-size-tiny: 11px;
}

/* ============================= */
/* BASIS-STYLES                  */
/* ============================= */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: var(--margin-section);
    background: var(--light-bg);
    font-size: var(--font-size-base);
}

/* Container */
.container,
.small-container,
.medium-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--white);
    color: var(--dark-color);
    padding: var(--padding-section);
    border-radius: var(--border-radius);
    margin-bottom: var(--margin-section);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #2C4F6F;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo-link {
    display: block;
    line-height: 0;
    transition: opacity 0.2s;
}

.header-logo-link:hover {
    opacity: 0.8;
}

.header-logo {
    height: 50px;
    width: auto;
    display: block;
}

.header-text {
    flex: 1;
}

.version-info {
    position: absolute;
    top: 50px;
    right: 15px;
    font-size: var(--font-size-tiny);
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 6px;
    border-radius: 3px;
    color: var(--dark-color);
}

.logout-section {
    position: absolute;
    top: 10px;
    right: 15px;
}

/* Sections */
.section {
    background: var(--white);
    padding: var(--padding-section);
    margin-bottom: var(--margin-section);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* ============================= */
/* TYPOGRAFIE                    */
/* ============================= */

h1,
h2,
h3 {
    margin: 0 0 15px 0;
    color: var(--dark-color);
}

h1 {
    font-size: var(--font-size-large);
}

h2 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

/* ============================= */
/* TABELLEN                      */
/* ============================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f8f9fa;
    font-weight: bold;
}

.faellig {
    background: #ffebee;
}

/* ============================= */
/* BUTTONS                       */
/* ============================= */

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

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

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

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

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

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

.btn-large {
    padding: 12px 25px;
    font-size: var(--font-size-base);
}

/* ============================= */
/* FORMULARE                     */
/* ============================= */

.form-group {
    margin-bottom: 15px;
}

.form-group-large {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark-color);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: var(--font-size-base);
}

input[type="text"],
input[type="date"] {
    padding: 12px;
}

textarea {
    height: 120px;
    resize: vertical;
}

textarea.large {
    height: 600px;
    font-family: monospace;
}

select {
    padding: 8px;
}

/* Form Layouts */
.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-item input[type="radio"] {
    width: auto;
}

/* ============================= */
/* STATUS & BADGES               */
/* ============================= */

.status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: var(--font-size-small);
    font-weight: bold;
}

/* Status-Farben werden durch PHP generiert */

/* ============================= */
/* SPEZIELLE KOMPONENTEN         */
/* ============================= */

/* Moderne Suchfunktion */
.search-container {
    background: linear-gradient(135deg, #2C4F6F 0%, #5B7E9B 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
}

.search-stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.quick-filter-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.quick-filter-btn.active {
    background: white;
    color: #2C4F6F;
    border-color: white;
}

/* Erweiterte Filter */
.advanced-filters-toggle {
    text-align: center;
    margin-top: 10px;
}

.advanced-filters-toggle .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.advanced-filters-toggle .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.advanced-filters {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideDown 0.3s ease;
}

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

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.filter-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: bold;
    color: white;
    opacity: 0.9;
}

.filter-item select {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

/* Original Toolbar */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Tags */
.stichwort-tag {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: var(--font-size-tiny);
    font-weight: bold;
    white-space: nowrap;
    display: inline-block;
    margin: 2px;
    cursor: pointer;
    border: 1px solid #ced4da;
    transition: all 0.2s;
    text-decoration: none;
}

.stichwort-tag:hover {
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
}

/* Für Link-Tags spezifische Styles */
a.stichwort-tag:visited {
    color: #495057;
}

a.stichwort-tag:visited:hover {
    color: var(--white);
}

/* Firmennamen-Links */
.firmen-link {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: normal;
    transition: all 0.2s;
    border-bottom: 1px dotted transparent;
}

.firmen-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
}

.firmen-link:visited {
    color: var(--dark-color);
}

.firmen-link:visited:hover {
    color: var(--primary-color);
}

.current-stichwort {
    background: #e8f5e8;
    color: #155724;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: var(--font-size-base);
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

/* Statistik-Karten */
.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    min-width: 120px;
    box-shadow: var(--box-shadow);
}

.stat-number {
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--dark-color);
}

.stat-label {
    font-size: var(--font-size-small);
    color: #7f8c8d;
    text-transform: uppercase;
}

/* Meta-Informationen */
.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.meta-label {
    font-size: var(--font-size-small);
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.meta-value {
    font-weight: bold;
    color: var(--dark-color);
}

/* ============================= */
/* ALERTS & MELDUNGEN            */
/* ============================= */

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 15px 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* ============================= */
/* GEFAHRENZONE                  */
/* ============================= */

.danger-zone {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.danger-zone h3 {
    color: #c53030;
    margin-top: 0;
}

.danger-zone-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.danger-zone-info {
    flex: 1;
}

/* ============================= */
/* UTILITY KLASSEN               */
/* ============================= */

/* Login-Seite */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.login-form {
    margin-bottom: 20px;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
}

.system-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
}

.security-note {
    background: #f8f9fa;
    border-left: 4px solid #17a2b8;
    padding: 10px 15px;
    margin-top: 20px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.required {
    color: var(--danger-color);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.hidden {
    display: none;
}

.kunde-option {
    display: none;
}

.kunde-option.active {
    display: block;
}

.help-section {
    background: #f8f9fa;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    border-radius: 4px;
}

/* ============================= */
/* RESPONSIVE DESIGN             */
/* ============================= */

@media (max-width: 768px) {

    .container,
    .small-container,
    .medium-container {
        margin: 10px;
        max-width: none;
    }

    body {
        margin: 10px;
    }

    .form-row {
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .stats {
        justify-content: center;
    }

    .ticket-meta {
        grid-template-columns: 1fr;
    }

    .version-info {
        position: static;
        margin-top: 10px;
        text-align: center;
    }

    .logout-section {
        position: static;
        margin-top: 10px;
        text-align: center;
    }

    .danger-zone-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        height: 40px;
    }
    
    /* Suchfunktion responsive */
    .search-container {
        padding: 15px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        padding: 12px 15px;
    }
    
    .quick-filters {
        justify-content: center;
    }
    
    .quick-filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
