/* Reset and base styles */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

/* Header styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
}

.tab-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: var(--card-bg);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    height: calc(100vh - 80px);
}

.tab-buttons {
    display: flex;
    background-color: var(--primary-color);
    border-bottom: 3px solid var(--accent-color);
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.tab-btn.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    padding: 0;
    height: calc(100% - 60px);
    width: 100%;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
    height: 100%;
}

.tab-pane.active {
    display: block;
    width: 100%;
    height: 100%;
}
.login-btn {
    width: 12rem; 
    padding: 1.5rem;
    background: linear-gradient(135deg, #54cce7 0%, #0f117b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}


.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

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

.connection-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border-left: 4px solid var(--accent-color);
}

.connection-info p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.connection-info strong {
    color: var(--primary-color);
}

.btn {
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #54cce7 0%, #0f117b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 1rem 2rem;
    margin-top: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: none;
}

.status-message.success {
    display: block;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.status-message.error {
    display: block;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.status-message.info {
    display: block;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

#terminal-container {
    margin-top: 1rem;
    background: #1e1e1e;
    border-radius: var(--border-radius);
    padding: 1rem;
}

#terminal-output {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}


/* Filter styles */
.filter-container {
    padding: var(--spacing-unit);
    background: var(--card-background);
    box-shadow: 0 2px 4px var(--shadow-color);
    position: sticky;
    top: 60px; /* Höhe des Headers */
    z-index: 999;
}

.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background: var(--card-background);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
    background: var(--primary-color);
    color: rgb(201, 68, 45);
    outline: none;
}

/* Main content */
main {
    padding: var(--spacing-unit);
    max-width: 1200px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    margin: 0 auto;
}

/* Card styles */
.card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    position: relative;
}

.card:hover,
.card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.image-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: var(--spacing-unit);
}

.card-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.tag {
    background-color: var(--background-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.price-level {
    margin-top: 0.5rem;
}

.price {
    color: #999;
    margin-right: 2px;
}

.price.active {
    color: var(--accent-color);
}

/* Favoriten Container */
.favorite-container {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--background-color);
    display: flex;
    justify-content: center;
}

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    padding: 0.5rem;
    transition: transform 0.2s ease;
    line-height: 1;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn:active {
    transform: scale(0.9);
}

.heart-icon {
    display: inline-block;
    transition: all 0.3s ease;
}

.favorite-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.favorite-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.card.is-favorite {
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Footer styles */
footer {
    background-color: var(--primary-color);
    color: rgb(206, 136, 7);
    padding: var(--spacing-unit);
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: rgb(206, 136, 7);
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus {
    text-decoration: underline;
    outline: none;
}

/* SQL Viewer Styles */
.sql-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    height: 600px;
}

.sql-sidebar {
    width: 200px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-y: auto;
}

.sql-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.tables-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-item {
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.table-item:hover {
    background: var(--accent-color);
    color: white;
    transform: translateX(4px);
}

.sql-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.query-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.query-controls h3 {
    color: var(--primary-color);
    margin: 0;
}

.sample-queries {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    background: var(--bg-color);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

#sql-query-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

#sql-query-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.query-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.sql-results {
    flex: 1;
    overflow: auto;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.results-table th {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.results-table td em {
    color: #95a5a6;
    font-style: italic;
}

.query-message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    font-weight: 500;
}

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

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

.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Mobile First Responsive Design */
@media (min-width: 480px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        display: flex;
    }

    .logo {
        margin-bottom: 0;
    }

    nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-right: 120px; /* Platz für den Counter */
    }

    .favorites-counter {
        top: 1rem;
        right: 1rem;
        font-size: 1rem;
    }

    .filter-container {
        top: 70px; /* Angepasste Höhe für größeren Header */
    }
}

@media (min-width: 768px) {
    .card.featured {
        grid-column: span 2;
    }

    nav {
        gap: 1rem;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 1100px) {
    .card.featured {
        grid-column: span 2;
    }
}

/* SQL Viewer Page Styles */
.sql-viewer-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.sql-viewer-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sql-viewer-header h1 {
    margin: 0;
    color: #667eea;
    font-size: 1.8rem;
}

.db-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.logout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.logout-btn:hover {
    transform: translateY(-2px);
}

.viewer-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.viewer-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.viewer-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.viewer-card-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.viewer-card-header p {
    margin: 0;
    opacity: 0.9;
}

.viewer-card-body {
    padding: 2rem;
}

.query-section {
    margin-bottom: 2rem;
}

.query-section h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.query-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
}

.query-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.results-section {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h3 {
    margin: 0;
    color: #2c3e50;
}

.result-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table-container table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    position: sticky;
    top: 0;
}

.table-container table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #ecf0f1;
    color: #34495e;
}

.table-container table tr:hover {
    background: #f8f9fa;
}

.message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.message.info {
    background: #e8f4f8;
    color: #2c3e50;
    border: 1px solid #b8e0f0;
}

.table-chip {
    background: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.table-chip:hover {
    background: #667eea;
    color: white;
}

.dropdown {
    width: 30%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    margin-bottom: 1rem;
}

.dropdown:focus {
    outline: none;
    border-color: #667eea;
}

.dropdown option {
    padding: 0.5rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}
/* Dashboard specific styles */
.header-logout-btn {
    position: absolute;
    right: 2rem;
    top: 1.2rem;
}

.sql-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

/* SQL Viewer specific styles */
.database-select-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.results-section {
    display: none;
}

.results-section.show {
    display: block;
}
