@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body,
form,
textarea,
button,
input[type="submit"] {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2, #e2e2e2);
    background-size: 200% 200%;
    animation: gradientAnimation 10s ease infinite;
    position: relative;
    overflow-y: auto;
}

form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 90%;
    margin-bottom: 20px;
    margin-top: 10vh;
}

h1 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    font-size: 1.1em;
    box-sizing: border-box;
}

.button-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    margin: 20px 0;
    width: 100%;
}

.button-container button {
    width: 100%;
    padding: 12px 15px;
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: normal;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.button-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Button-Positionen */
#resetButton {
    grid-row: 1;
    grid-column: 1;
    background-color: #dc3545;
}

button[type="submit"] {
    grid-row: 1;
    grid-column: 2;
    background-color: #28a745;
}

#pasteButton {
    grid-row: 2;
    grid-column: 1;
    background-color: #3498db;
}

#removeDuplicatesButton {
    grid-row: 2;
    grid-column: 2;
    background-color: #6c5ce7;
}

/* Dark Mode Styles für alle Buttons */
.button-container button.dark-mode {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.button-container button.dark-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* Button-Farben und spezifische Hover-Effekte */
#resetButton {
    background-color: #dc3545;
}

#resetButton:hover {
    background-color: #c82333;
}

button[type="submit"] {
    background-color: #28a745;
}

button[type="submit"]:hover {
    background-color: #218838;
}

#pasteButton {
    background-color: #3498db;
}

#pasteButton:hover {
    background-color: #2980b9;
}

#removeDuplicatesButton {
    background-color: #6c5ce7;
}

#removeDuplicatesButton:hover {
    background-color: #5f3dc4;
}

/* Dark Mode Styles für alle Buttons */
.button-container button.dark-mode {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.button-container button.dark-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

#resetButton.dark-mode {
    background-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

#resetButton.dark-mode:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

button[type="submit"].dark-mode {
    background-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

button[type="submit"].dark-mode:hover {
    background-color: #219a52;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#pasteButton.dark-mode {
    background-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

#pasteButton.dark-mode:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#removeDuplicatesButton.dark-mode {
    background-color: #6c5ce7;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

#removeDuplicatesButton.dark-mode:hover {
    background-color: #5f3dc4;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.error-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.error-message {
    background-color: #ff4757;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.error-message.dark-mode {
    background-color: rgba(231, 76, 60, 0.9);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    form, .statistics-container {
        padding: 20px;
        width: 95%;
    }

    h1 {
        font-size: 1.2em;
    }

    textarea {
        height: 120px;
    }

    .button-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .button-container button {
        font-size: 0.85em;
        padding: 10px;
    }

    form {
        margin-top: 10vh;
    }
}

@media (max-height: 600px) {
    form {
        margin-top: 5vh;
    }
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1c2e, #2d3436, #1a1c2e);
    color: #ffffff;
    transition: background 0.5s ease, color 0.3s ease;
}

form.dark-mode {
    background: #1e2124;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

textarea.dark-mode {
    background: #2c3338;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

textarea.dark-mode::placeholder {
    color: #a0a0a0;
}

textarea.dark-mode:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
    outline: none;
    background: #363b41;
}

h1.dark-mode {
    color: #ffffff !important;
}

/* Verbesserte Dark Mode Button Styles */
#resetButton.dark-mode {
    background-color: #e74c3c;
    color: #f5f6fa;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    transition: all 0.3s ease;
}

#resetButton.dark-mode:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

button[type="submit"].dark-mode {
    background-color: #27ae60;
    color: #f5f6fa;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
    transition: all 0.3s ease;
}

button[type="submit"].dark-mode:hover {
    background-color: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* Verbesserte Error/Success Messages im Dark Mode */
.error-message.dark-mode {
    background-color: rgba(231, 76, 60, 0.9);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.success-message.dark-mode {
    background-color: rgba(39, 174, 96, 0.9);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

/* Dark Mode Toggle Button */
#darkModeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f8f9fa;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1em;
    z-index: 1000;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#darkModeToggle:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#darkModeToggle.dark-mode {
    background: #343a40;
    color: white;
    border-color: #495057;
}

#darkModeToggle.dark-mode:hover {
    background: #495057;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

#darkModeIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#pasteButton:hover {
    background-color: #2980b9;
}

#pasteButton.dark-mode {
    background-color: #3498db;
    color: #f5f6fa;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

#pasteButton.dark-mode:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Favoriten-Styles */
.favorites-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#favoritesList {
    flex-grow: 1;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1em;
}

#favoritesList.dark-mode {
    background: #2c3338;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

#saveFavoriteButton,
#deleteFavoriteButton {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

#saveFavoriteButton {
    background-color: #17a2b8;
    color: white;
}

#saveFavoriteButton:hover {
    background-color: #138496;
}

#deleteFavoriteButton {
    background-color: #dc3545;
    color: white;
}

#deleteFavoriteButton:hover {
    background-color: #c82333;
}

#saveFavoriteButton.dark-mode,
#deleteFavoriteButton.dark-mode {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#saveFavoriteButton.dark-mode:hover,
#deleteFavoriteButton.dark-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Fortschrittsanzeige Styles */
.progress-container {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    position: relative;
}

.progress-text {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Dark Mode Styles für Fortschrittsanzeige */
.progress-bar.dark-mode {
    background-color: #2c3338;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.progress-bar-fill.dark-mode {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.progress-text.dark-mode {
    color: #ffffff;
}

.help-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.help-text.dark-mode {
    color: #aaa;
}

/* Tooltip Styles */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

.dark-mode [title]:hover::before {
    background: rgba(255, 255, 255, 0.9);
    color: black;
}

/* File Upload Styles */
.file-upload-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: #17a2b8;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.file-label:hover {
    background-color: #138496;
    transform: translateY(-1px);
}

.file-icon {
    font-size: 1.2em;
}

.file-name {
    flex-grow: 1;
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark Mode Styles für File Upload */
.file-label.dark-mode {
    background-color: #2980b9;
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
}

.file-label.dark-mode:hover {
    background-color: #2471a3;
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.file-name.dark-mode {
    color: #aaa;
}

/* Statistik Styles */
.statistics-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
    margin-bottom: 20px;
}

.statistics-container.dark-mode {
    background: #1e2124;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.statistics-container h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.statistics-container.dark-mode h2 {
    color: #ffffff;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card.dark-mode {
    background: #2c3338;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #444;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.stat-card.dark-mode h3 {
    color: #ffffff;
    border-bottom-color: #444;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item.dark-mode {
    border-bottom-color: #444;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.stat-value {
    font-weight: 600;
    color: #2ecc71;
}

.dark-mode .stat-label {
    color: #aaa;
}

.dark-mode .stat-value {
    color: #27ae60;
}

.empty-state {
    color: #999;
    text-align: center;
    font-style: italic;
    padding: 20px 0;
}

.dark-mode .empty-state {
    color: #666;
}

.statistics-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.statistics-actions button {
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.statistics-actions .secondary-button {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.statistics-actions .secondary-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.statistics-actions .primary-button {
    background-color: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.statistics-actions .primary-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Dark Mode Styles für die Statistik-Buttons */
.dark-mode .statistics-actions .secondary-button {
    background-color: #e74c3c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.dark-mode .statistics-actions .secondary-button:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.dark-mode .statistics-actions .primary-button {
    background-color: #2ecc71;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

.dark-mode .statistics-actions .primary-button:hover {
    background-color: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

@media (max-width: 768px) {
    .statistics-actions {
        flex-direction: column;
    }

    .statistics-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip Verbesserungen */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Drag & Drop Bereich */
.drag-active {
    border: 2px dashed #3498db !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    resize: none;
    font-size: 1.1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.button-container button.loading {
    position: relative;
    cursor: wait;
}

.button-container button.loading .spinner {
    display: inline-block;
}

.button-container button.loading:hover {
    transform: none;
}

/* Verbesserte Erfolgsmeldungen */
.success-message {
    background-color: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message:before {
    content: '✓';
    font-weight: bold;
    font-size: 1.2em;
}

/* Datei-Upload Bereich */
.file-upload-container {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.file-upload-container:hover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.file-upload-container .file-icon {
    font-size: 2em;
    margin-bottom: 10px;
    color: #666;
}

.supported-formats {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Dark Mode Anpassungen */
.dark-mode .drag-active {
    border-color: #6c5ce7 !important;
    background-color: rgba(108, 92, 231, 0.1) !important;
}

.dark-mode [data-tooltip]:before {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

.dark-mode .file-upload-container {
    border-color: #444;
}

.dark-mode .file-upload-container:hover {
    border-color: #6c5ce7;
    background-color: rgba(108, 92, 231, 0.05);
}

.dark-mode .file-icon {
    color: #aaa;
}

.dark-mode .supported-formats {
    color: #aaa;
}