/* STTS Audio Portal Stylesheet */
:root {
    --sonic-blue: #0297d4;
    --sonic-blue-hover: #007bb5;
    --sonic-dark: #2c3e50;
    --bg-color: #f4f4f4;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #dddddd;
    --border-radius: 8px;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

body {
    font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.95rem;
}

header nav a {
    color: #555;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

header nav a:hover, header nav a.active-link {
    color: var(--sonic-blue);
    font-weight: bold;
}

header nav a.logout-link {
    color: #b02a37;
}

header nav a.logout-link:hover {
    color: #721c24;
    background: #f8d7da;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.portal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.portal-header h2 {
    color: var(--sonic-dark);
    margin-bottom: 0.35rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0;
}

/* Tabs */
.stts-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 4px 4px 0 0;
}

.tab-button:hover {
    color: var(--sonic-blue);
    background-color: #f8f9fa;
}

.tab-button.active {
    color: var(--sonic-blue);
    border-bottom-color: var(--sonic-blue);
    background-color: #edf7fc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards and forms */
.stts-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.stts-card h3 {
    margin-top: 0;
    color: var(--sonic-dark);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.stts-card .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-card {
    max-width: 480px;
    margin: 1.5rem auto;
    text-align: left;
}

.auth-form {
    max-width: 480px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-icon {
    font-size: 3rem;
    color: var(--sonic-blue);
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--sonic-blue);
    box-shadow: 0 0 0 3px rgba(2, 151, 212, 0.2);
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.char-counter.limit-near {
    color: #e67e22;
    font-weight: bold;
}

.char-counter.limit-exceeded {
    color: var(--danger-color);
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background-color: var(--sonic-blue);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--sonic-blue-hover);
}

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    color: var(--success-color);
    border-color: var(--success-color);
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: #fff;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.btn-icon:hover {
    color: var(--danger-color);
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #b8c8d4;
    background-color: #f9fbfd;
    border-radius: var(--border-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 1.25rem;
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
    border-color: var(--sonic-blue);
    background-color: #eef7fc;
}

.upload-icon {
    font-size: 3rem;
    color: var(--sonic-blue);
    margin-bottom: 0.75rem;
}

.upload-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    color: var(--sonic-dark);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.selected-file-badge {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e1f0f8;
    color: #034b6b;
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Status & Results */
.status-box {
    padding: 1.25rem;
    border-radius: 6px;
    margin-top: 1.25rem;
    text-align: center;
}

.loading-box {
    background: #edf7fc;
    border: 1px solid #bce2f5;
    color: #035275;
}

.spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.75rem auto;
    border: 4px solid rgba(2, 151, 212, 0.2);
    border-top-color: var(--sonic-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid #c3e6cb;
    background-color: #f7fcf8;
    border-radius: var(--border-radius);
}

.result-box h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #155724;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.audio-player-wrapper {
    margin-bottom: 1rem;
}

.audio-player {
    width: 100%;
}

.result-textarea {
    background: #ffffff;
    font-family: inherit;
    line-height: 1.6;
}

.alert {
    padding: 0.85rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.text-success {
    color: var(--success-color);
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
}

.stts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.stts-table th, .stts-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.stts-table th {
    background-color: #f8f9fa;
    color: var(--sonic-dark);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.compact-select {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.align-bottom {
    margin-bottom: 1.25rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.modal-header h4 {
    margin: 0;
    color: var(--sonic-dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Footer matching sonicTOOLS global layout */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #555;
}

footer nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Cookie Banner matching sonicTOOLS layout */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    color: #fff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none; /* Versteckt standardmäßig */
}

.cookie-banner p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.cookie-banner button {
    background-color: #0297d4;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.cookie-banner button:hover {
    background-color: #0298d4a2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    nav {
        justify-content: center;
    }
    .stts-tabs {
        flex-direction: column;
    }
    .tab-button {
        width: 100%;
        text-align: left;
    }
    .grid-form {
        grid-template-columns: 1fr;
    }
}
