/* css/custom.css */

/* Basis-Stile für html und body */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Allgemeine Basis-Stile */
body {
    padding-top: 5px;
}

.card, .card-header, .card-body {
  margin: 0 !important;
  padding: 0 !important;
}

.card-header {
    background-color: #ffffff !important;
    border-bottom: none !important;
    padding: 10px 0;
    margin: 0 8px;
    display: flex;
    align-items: center;
    min-height: 40px;  /* Minimale Höhe entsprechend dem blauen Balken */
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 12px;  /* Mehr Abstand zwischen den Icons für bessere Klickbarkeit */
    margin-right: 8px;
}

/* Reduziere das Padding im Card-Body, damit mehr Platz für den Textbereich bleibt */
.card-body {
    display: flex;
    flex-direction: column;
    padding-top: 0;
    padding-bottom: 5px;
    padding-left: 8px;
    padding-right: 8px;
}

.search-result {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result:hover {
    background-color: #f8f9fa;
}

.search-result h6 {
    margin-bottom: 5px;
}

.search-result p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 0;
}

.trash-item {
    padding: 15px 0;
}

.trash-item h6 {
    margin-bottom: 5px;
}

.trash-item button {
    margin-left: 5px;
}

.trash-item:hover {
    background-color: #f8f9fa;
}
.trash-item .btn {
    width: 140px;
    margin-left: 5px;
}

/* Falls nötig: Allgemeiner Abstand zwischen den Form-Group-Elementen verringern */
#recordForm .form-group {
    margin-bottom: 10px; /* Standardmäßig etwas weniger Abstand */
}

.matching-list-items {
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid #eee;
}

/* Spezifische Anpassung für die Button-Gruppen */
.button-group {
    margin-top: 5px;     /* Weniger Abstand oberhalb */
    margin-bottom: 5px;  /* Weniger Abstand unterhalb */
    padding-top: 0;      /* Kein zusätzliches Padding oben */
    padding-bottom: 0;   /* Kein zusätzliches Padding unten */
}

/* Falls du den Abstand der Buttons innerhalb der Gruppe noch weiter anpassen möchtest,
   kannst du auch den Margin der btn-custom-Klasse oder der m-1-Klasse reduzieren. */

.neu-button {
    position: fixed;      /* Fixiert den Button relativ zum Browserfenster */
    top: 35px;            /* Abstand vom oberen Rand */
    right: 20px;          /* Abstand vom rechten Rand */
    z-index: 10000;       /* Höherer z-index, damit er über anderen Elementen liegt */
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
}
.neu-button:hover {
    background-color: #218838;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon:hover {
    color: #0d6efd;
}

.btn-icon img {
    width: 32px;
    height: 32px;
}

.icon-bar {
    width: 100%;
    height: 8px;  /* Ultra-kompakt */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;  /* Größerer Klickbereich */
    cursor: pointer;
    color: #495057;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grundfarbe für alle Icons in btn-icon */
.btn-icon i,
.btn-icon svg {
    transition: color 0.2s;
    color: #3498db !important; /* Blau für alle Icons, !important um andere Stile zu überschreiben */
}

/* Hover-Effekt für alle Icons */
.btn-icon:hover:not(:disabled) i,
.btn-icon:hover:not(:disabled) svg {
    color: #2980b9 !important; /* Dunkleres Blau beim Hover */
}

/* Disabled-Zustand */
.btn-icon:disabled i,
.btn-icon:disabled svg,
.btn-disabled i,
.btn-disabled svg {
    opacity: 0.6;
    color: #3498db !important;
    cursor: not-allowed;
}

.btn-icon:disabled,
.btn-disabled {
    opacity: 1; /* Button selbst nicht transparent machen */
    cursor: not-allowed;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Responsive Anpassungen für kleine Bildschirme */
@media (max-width: 576px) {
    .header-icons {
        gap: 8px;  /* Etwas weniger Abstand auf kleinen Bildschirmen */
        margin-right: -13px;  /* Weniger negativer Margin auf kleinen Bildschirmen */
    }
    
    .btn-icon {
        padding: 6px;  /* Etwas kleinerer Klickbereich, aber immer noch gut bedienbar */
    }
}

.card-dates {
  font-size: 0.8rem;
  line-height: 1;
  padding: 1px 5px;  /* Weniger vertikales Padding */
  margin: 0;
  margin-left: 5px;
}

.date-row {
  display: flex;
  align-items: center;
  margin: 0;
}

.date-row .label {
  font-weight: bold;
  width: 80px;
  margin-right: 5px;
}

.date-row .value {
  flex: 1;
}



#login_id, .container {
	max-width: 800px;
	margin: 0 auto;
	padding: 10px;
}

/* Stile für den Haupttitel */
.title-box {
	background-color: #fff;
	padding: 10px;
	margin-bottom: 30px;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	text-align: center;
	font-size: 36px;
	font-weight: bold;
	color: #2c3e50;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stile für Sekundäre Überschriften */
h2 {
	font-size: 24px;
	margin-bottom: 20px;
	color: #333;
}

/* Gemeinsame Stile für die Formulare */
form {
	background-color: #fff;
	padding: 10px;
	margin-bottom: 10px;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #555;
}

input[type="submit"], #recordButton, #anmelden {
	background: linear-gradient(to bottom, #3498db 0%, #2980b9 100%); /* Blauer Farbverlauf */
	color: white;
	padding: 6px 10px;
	border: none;
	border-radius: 8px; /* Abgerundete Ecken */
	cursor: pointer;
	font-size: 14px;
	box-shadow: 0 5px #2471a3; /* Dunklerer Schatten für 3D-Effekt */
	transition: all 0.3s ease; /* Sanfte Übergänge */
	transform: perspective(1px) translateZ(0); /* Vorbereitung für 3D-Effekte */
	backface-visibility: hidden; /* Verbessert die Rendering-Leistung */
	position: relative;
	overflow: hidden;
	white-space: nowrap; /* Verhindert den Umbruch des Textes */
}

input[type="submit"]::before, #recordButton::before, #anmelden::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.2);
	opacity: 0;
	transition: opacity 0.3s ease;
	border-radius: 8px;
}

input[type="submit"]:hover::before, #recordButton:hover::before, #anmelden::before {
	opacity: 1;
}

input[type="submit"]:hover, #recordButton:hover, #anmelden:hover {
	background: linear-gradient(to bottom, #2980b9 0%, #3498db 100%); /* Umgekehrter Farbverlauf beim Hover */
	box-shadow: 0 8px #1f618d; /* Erhöhter Schatten beim Hovern */
	transform: scale(1.05); /* Leicht vergrößern beim Hover */
}

input[type="submit"]:active, #recordButton:active, #anmelden:active {
	box-shadow: 0 2px #1a5276; /* Reduzierter Schatten beim Klicken */
	transform: translateY(3px) scale(0.95); /* Nach unten drücken und verkleinern */
}


/* Container Ausrichtung */
.container-custom {
    max-width: 1400px;
    margin: 0 auto;
}

/* Row Ausrichtung */
.row.align-items-start {
    display: flex;
    align-items: flex-start;
    margin: 0;
}

/* Spalten */
.col-12 {
    padding: 0 10px;
}

/* Accordion */
#accordion {
    margin-top: 0;
}

/* Card */
.card.h-100 {
    height: 100%;
    margin: 0;
}

/* Card Header */
.card-header {
    padding: 10px;
    background-color: #ffffff !important;
    border-bottom: none !important;
}

/* Card Body */
.card-body {
    padding: 10px;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Anpassung für den Card-Header (kleinere Schriftgröße) */
.card-header .row > div {
    font-size: 0.9rem;
}

/* Button-Stile mit 3D-Effekt und gleicher Mindestbreite */
.btn-custom {
    min-width: 120px;
    padding: 5px 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
}

.btn-custom:active {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}

/* jQuery UI Accordion Stile */
#accordion h3 {
    font-size: 1rem;
    padding: 10px;
    margin: 0;
    cursor: pointer;
}

#accordion .ui-accordion-content {
    padding: 5px 15px;
    border: 1px solid #dee2e6;
    border-radius: 0 0 4px 4px;
    background: #fff;
    min-height: auto !important;
}

/* Linke Spalte: Accordion-Container */
/* Dieser Bereich soll nur so breit sein wie der Inhalt (maximal 300px) plus etwas Padding */
.accordion-container {
    padding: 10px;
    /* Die Breite richtet sich nach dem Inhalt, geht aber nicht über 300px hinaus */
    width: auto;
    max-width: 300px;
}

/* Optional: Falls du den Accordion-Bereich noch weiter einschränken möchtest, 
   kannst du hier eine feste Breite (oder einen Prozentwert) angeben. */
/* .accordion-container {
       width: 30%; 
       max-width: 300px;
   }
*/

/* Für große Bildschirme (Beispiel: ab 1200px Breite) kann man die linke Spalte auf 1/3 des Gesamtbereichs begrenzen */
@media (min-width: 1200px) {
    .accordion-container {
        /* Damit die linke Spalte niemals mehr als 33% der Gesamtbreite einnimmt */
        flex: 0 0 33%;
    }
}
@media (max-width: 576px) {
  #accordion {
    max-height: 200px; /* Beispiel: Höhe begrenzen */
    overflow-y: auto;
  }
}

/* Erweiterung für custom.css - Smooth Transitions */

/* Sanfte Übergänge für Formularfelder */
.form-control {
    transition: all 0.3s ease-in-out;
}

/* Animation beim Speichern */
.form-control.saving {
    background-color: #f8f9fa;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-control.saved {
    background-color: #d4edda;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
    transition: background-color 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}

/* Elefantenbild sanft überblenden */
.elephant-background {
    transition: opacity 0.3s ease-in-out;
}

/* Sanfte Übergänge zwischen den Ansichten */
#recordForm, #listContainer, #accordion {
    transition: opacity 0.2s ease-in-out;
}

/* Accordion-Übergänge */
.ui-accordion-content {
    transition: height 0.3s ease-in-out;
}

/* Animation für den Kategoriewechsel */
#kategorie {
    transition: all 0.3s ease-in-out;
}

#kategorie.changed {
    background-color: #fff3cd;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

/* Verbesserte Hover-Effekte für Navigations-Elements */
.navigation-link {
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.navigation-link:hover {
    color: #007bff !important;
    transform: translateX(2px);
}

/* Verbesserter Hover-Effekt für Accordion-Items */
#accordion a {
    display: block;
    padding: 4px 0;
    transition: all 0.2s ease;
    border-radius: 3px;
}

#accordion a:hover {
    background-color: #f8f9fa;
    padding-left: 5px;
    text-decoration: none;
}

/* Sanfter Übergang für Listen-Items */
.list-item {
    position: relative;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.list-item-text {
    resize: none;
    overflow: hidden;
    min-height: 38px;
    line-height: 1.4;
    transition: height 0.2s ease;
    flex-grow: 1;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.list-item-text:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.list-item .form-check-input {
    margin-top: 0.5rem;
}

.list-item .btn-icon {
    padding: 0.375rem;
    line-height: 1;
    margin-top: 0.25rem;
}

.list-items .list-item {
	transition: background-color 0.3s ease, transform 0.2s ease;
}
.list-items .list-item.dragging {
	box-shadow: 0 4px 8px rgba(0,0,0,0.1);
	z-index: 1000;
}
.list-items .list-item.updated {
	background-color: rgba(240, 255, 240, 0.8);
}
.sort-placeholder {
	border: 1px dashed #ccc;
	background-color: #f9f9f9;
	height: 38px;
	margin-bottom: 0.5rem;
}
.drag-handle {
	cursor: move;
	padding: 7px 5px;
	color: #999;
	display: flex;
	align-items: center;
	position: absolute;
	left: -24px;
	top: 0;
	height: 100%;
	z-index: 5;
}
.drag-handle:hover {
	color: #666;
}
.list-items {
	padding-left: 24px; /* Platz für Drag-Handles */
}

/* Accordion Styles */
.ui-accordion {
    margin-top: 20px;
}

.ui-accordion .ui-accordion-header {
    background: #f8f9fa;
    color: #495057;
    padding: 8px 15px;
    margin: 2px 0;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: auto;
}

.ui-accordion .ui-accordion-header:hover {
    background: #e9ecef;
}

/* Aktiver Header */
.ui-accordion .ui-accordion-header.ui-accordion-header-active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
    order: 2;
    margin-left: auto;
    position: relative;
    top: 2px; /* Reduziert von 50% auf einen festen Wert */
}

/* Verbesserte Links im Accordion */
#accordion a {
    display: block;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 3px;
    color: #495057;
    text-decoration: none;
}

#accordion a:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    padding-left: 12px;
}

/* Login Form Styles */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-card .card-header {
    background: #0d6efd;
    color: white;
    border-radius: 8px 8px 0 0;
    padding: 20px;
}

.login-card .card-body {
    padding: 20px;
}

.login-card .form-control {
    margin-bottom: 15px;
}

/* 3D Button Style */
.btn-3d {
    position: relative;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    box-shadow: 0 4px #0a58ca;
    width: 200px;
    margin: 0 auto;
    display: block;
}

.btn-3d:hover {
    background: #0b5ed7;
    transform: perspective(1000px) translateY(-2px);
}

.btn-3d:active {
    background: #0a58ca;
    transform: perspective(1000px) translateY(2px);
    box-shadow: 0 2px #094db1;
}

/* Centered Heading Style */
.card-header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    color: #e6e6e6;
}

.ql-toolbar .ql-picker-label {
  max-width: 90px !important;
  width: 90px !important;
}

span.ql-header.ql-picker {
  max-width: 90px !important;
  width: 90px !important;
}

.ql-toolbar .ql-formats > button {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  box-sizing: border-box;
}

span.ql-formats {
  margin: 0 !important;
}

.ql-toolbar .ql-formats > button svg {
  width: 18px !important;
  height: 18px !important;
}

#recordForm {
  padding-left: 8px;
  padding-right: 8px;
}

#editorContainer {
  flex: 1 1 auto;
  height: 100%;
  min-height: 200px;
  max-height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-radius: 0.25rem;
}

#editor {
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  overflow: auto;
}

.ql-editor {
  min-height: 120px;
  max-height: 100%;
  overflow: auto;
}

@media (max-width: 768px) {
    .card-header {
        padding-right: 0 !important;
    }
    .header-icons {
        position: relative !important;
        left: -20px !important;
        right: 0 !important;
    }
}

/* Mikrofon-Button Styling */
#microphoneButton {
    position: fixed;
    top: 80px;
    right: 30px;
    z-index: 1000;
    background: none;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    color: #007bff;
    transition: color 0.2s;
    /* Mobile Touch-Optimierungen */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Verbesserte Touch-Bereich */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Verbesserte Animation für aktiven Zustand */
#microphoneButton.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

#microphoneButton i.mic-active {
    color: #dc3545 !important;
}

.mic-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: box-shadow 0.2s, background 0.2s;
}
.mic-circle.active {
    box-shadow: 0 0 0 2px #dc3545;
    background: rgba(220,53,69,0.08);
}

#microphoneButton .mic-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 123, 255, 0.2);
}
#microphoneButton .mic-bg i[data-lucide] {
    color: #3498db !important;
    transition: color 0.2s;
}

/* Mikrofon-Icon selbst blau färben */
#microphoneButton .mic-bg svg {
    color: #3498db !important;
    fill: none;
    stroke: #3498db !important;
}

#microphoneButton .mic-bg svg path,
#microphoneButton .mic-bg svg rect,
#microphoneButton .mic-bg svg circle {
    stroke: #3498db !important;
}
#microphoneButton.active .mic-bg {
    background: #dc3545;
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.3);
}
#microphoneButton.active .mic-bg i[data-lucide] {
    color: #fff;
}

/* Responsive Anpassungen für den schwebenden Button */
@media (max-width: 768px) {
    #microphoneButton {
        top: 65px;
        right: 25px;
    }
    
    #microphoneButton .mic-bg {
        width: 44px;
        height: 44px;
    }
}

/* Animation für Ladeindikator */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styling für OpenAI-Überprüfungsdialog */
#speechCheckDialog .btn {
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

#speechCheckDialog .btn-primary {
    background: #007bff;
    color: white;
}

#speechCheckDialog .btn-primary:hover {
    background: #0056b3;
}

#speechCheckDialog .btn-secondary {
    background: #6c757d;
    color: white;
}

#speechCheckDialog .btn-secondary:hover {
    background: #545b62;
}

/* Verbesserte Status-Nachrichten */
#microphoneStatus {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hover-Effekt für Mikrofon-Button */
#microphoneButton:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

#microphoneButton:hover .mic-bg {
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Verbesserte visuelle Rückmeldung für aktiven Zustand */
#microphoneButton.active:hover {
    transform: scale(1.1);
}

#microphoneButton.active .mic-bg {
    animation: recordingPulse 2s infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 2px 20px rgba(220, 53, 69, 0.6);
    }
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure the button text is hidden when loading */
.btn-loading .fas,
.btn-loading span {
    opacity: 0;
}