/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors */
    --primary-color: #0066ff;
    --primary-light: #0099ff;
    --primary-dark: #0052cc;
    --secondary-color: #00ccff;
    --accent-color: #0066ff;
    --accent-light: #3399ff;
    
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #0066ff 0%, #00ccff 100%);
    --gradient-secondary: linear-gradient(135deg, #00ccff 0%, #00ff9d 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #00ccff 100%);
    --gradient-coral: linear-gradient(135deg, #ff6f61 0%, #3399ff 100%);
    --gradient-mint: linear-gradient(135deg, #00ff9d 0%, #ffd700 100%);
    
    /* Background Colors */
    /* Slightly off-white primary background to separate page areas */
    --primary-bg: #fbfdff;
    --secondary-bg: #f6f8fb;
    --card-bg: #ffffff;
    --hover-bg: #f0f4f8;
    
    /* Text Colors */
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* Border & Shadow (higher contrast for light mode) */
    --border-color: #d0d7de;
    --card-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    
    /* Other */
    --warning-color: #ffc107;
    --transition: all 0.3s ease;
}

body.dark-mode {
    --primary-bg: #0f1419;
    --secondary-bg: #1a1f2e;
    --card-bg: #1e2530;
    --hover-bg: #2a3240;
    
    --text-color: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    
    --border-color: #2a3240;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========================================
   SHARED / GLOBAL STYLES
   ======================================== */
body {
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--primary-bg);
    transition: var(--transition);
}

/* Improve boundaries between sections in light mode */
section:not(.hero) {
    background-color: var(--primary-bg);
    border-top: 1px solid var(--border-color);
}

/* Make the navbar more distinct on light backgrounds */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(16,24,40,0.04);
}

/* Impressum: make navbar match page background and remove border/shadow */
.impressum-page .navbar {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

/* Ensure impressum navbar in dark mode also matches background */
.impressum-page.dark-mode .navbar {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

/* Make theme-toggle visible in impressum navbar */
.impressum-page .navbar .theme-toggle {
    background: var(--accent-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.impressum-page.dark-mode .navbar .theme-toggle {
    background: var(--accent-color);
    color: #fff;
}

/* Ensure containers inside sections have breathing room and subtle background */
section > .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Slightly different background for cards/panels to emphasize boundaries */
.card, .panel, .feedback-form-wrapper, .feedback-summary-wrapper, .service-card, .feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

/* Footer separation */
.footer {
    border-top: none;
}

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

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    word-wrap: break-word;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Headings */
h1, h2, h3, h4 {
    color: var(--text-color);
    margin: 0;
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin: 0.5rem 0;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

body.dark-mode .btn-secondary {
    /* in dark mode --text-color is light, so this keeps contrast */
    color: var(--text-color);
    border-color: var(--accent-light);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.submit-btn {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
    text-decoration: none;
}

/* Improve navbar brand/link contrast and spacing */
.navbar-brand a {
    color: var(--text-color);
    text-decoration: none;
}

/* 404 / error page container adjustments */
.container-404 {
    max-width: 920px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.error-code {
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.error-message p { color: var(--text-secondary); }

.quick-links { display:flex; flex-wrap:wrap; gap:0.6rem; justify-content:center; margin-top:1rem; }
.quick-links .btn { min-width:160px; }

/* Ensure primary buttons stand out on light backgrounds */
.btn-primary { box-shadow: 0 6px 18px rgba(0, 102, 255, 0.18); }

/* Ensure cards and panels have slightly stronger borders in light mode */
.feedback-form-wrapper, .feedback-summary-wrapper, .service-card, .feature-card {
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

/* HERO: make title/subtitle larger and more readable on all viewports */
.hero .hero-title {
    /* reduced max size for better balance */
    font-size: clamp(1.6rem, 4.4vw, 2.6rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.08;
    margin: 0;
}

.hero .hero-subtitle {
    font-size: clamp(0.95rem, 1.9vw, 1.15rem);
    color: rgba(255,255,255,0.92);
    max-width: 900px;
    margin: 0 auto 0.75rem;
}

/* On hero, secondary buttons should be visible against gradient background - blue tone */
.hero .btn-secondary {
    color: #ffffff !important;
    background: rgba(0,102,255,0.16) !important;
    border: 2px solid rgba(0,102,255,0.28) !important;
    font-weight: 600;
}

.hero .btn-secondary:hover {
    background: rgba(0,102,255,0.22) !important;
}

/* Hero text color in light mode should be dark per request */
body:not(.dark-mode) .hero .hero-title {
    color: var(--text-color) !important;
}

body:not(.dark-mode) .hero .hero-subtitle {
    color: var(--text-secondary) !important;
}

/* Back-to-home: white background and black text in both modes */
.back-to-home {
    background-color: var(--primary-color) !important;
    color: #000 !important;
    border: 1px solid var(--border-color);
}

.back-to-home:hover {
    background-color: var(--primary-light) !important;
}

.nav-link.active {
    color: var(--accent-color);
    background-color: var(--hover-bg);
}

/* ========================================
   INDEX.HTML STYLES
   ======================================== */

/* Hero Section */
.hero {
    /* hero uses flex layout to center content */
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0 2rem;
}

/* Robust centering for hero content */
.hero {
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Hero content centering and button layout */
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
}

.hero .btn {
    min-width: 140px;
}

/* Make the hero 'Feedback geben' secondary button more visible (blue tone) */
.hero .btn-secondary {
    color: #ffffff !important;
    background: rgba(0,102,255,0.16) !important;
    border: 2px solid rgba(0,102,255,0.28) !important;
}

.hero .btn-secondary:hover {
    background: rgba(0,102,255,0.22) !important;
}

.hero::after {
    content: '';
    border: none;
    box-shadow: none;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(51, 153, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 204, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

/* Floating Cubes */
.floating-cube {
    position: absolute;
    border-radius: 12px;
    opacity: 0.7;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    will-change: transform;
    transition: box-shadow 0.3s;
}

.floating-cube-1 {
    width: 80px;
    height: 80px;
    top: 8%;
    left: 2%;
    background: var(--gradient-primary);
    animation: float-cube-1 7s ease-in-out infinite;
}

.floating-cube-2 {
    width: 120px;
    height: 120px;
    top: 65%;
    left: 4%;
    background: var(--gradient-secondary);
    animation: float-cube-2 9s ease-in-out infinite;
}

.floating-cube-3 {
    width: 60px;
    height: 60px;
    top: 12%;
    right: 3%;
    background: var(--gradient-gold);
    animation: float-cube-3 6s ease-in-out infinite;
}

.floating-cube-4 {
    width: 100px;
    height: 100px;
    top: 80%;
    right: 5%;
    background: var(--gradient-coral);
    animation: float-cube-4 8s ease-in-out infinite;
}

.floating-cube-5 {
    width: 50px;
    height: 50px;
    top: 35%;
    left: 6%;
    background: var(--gradient-mint);
    animation: float-cube-5 5s ease-in-out infinite;
}

.floating-cube-6 {
    width: 90px;
    height: 90px;
    top: 85%;
    left: 92%;
    background: var(--gradient-coral);
    animation: float-cube-6 10s ease-in-out infinite;
}

.floating-cube-7 {
    width: 70px;
    height: 70px;
    top: 18%;
    right: 8%;
    background: linear-gradient(135deg, #00ccff 0%, #ff6f61 100%);
    animation: float-cube-7 7.5s ease-in-out infinite;
}

.floating-cube-8 {
    width: 40px;
    height: 40px;
    top: 70%;
    left: 96%;
    background: var(--gradient-mint);
    animation: float-cube-8 6.5s ease-in-out infinite;
}

/* Cube Animations */
@keyframes float-cube-1 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(30px) rotate(12deg); }
}

@keyframes float-cube-2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(-8deg); }
}

@keyframes float-cube-3 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(20px) rotate(20deg); }
}

@keyframes float-cube-4 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(-15deg); }
}

@keyframes float-cube-5 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(15px) rotate(10deg); }
}

@keyframes float-cube-6 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(-18deg); }
}

@keyframes float-cube-7 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(22px) rotate(8deg); }
}

@keyframes float-cube-8 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(-6deg); }
}

/* Section Titles */
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0 0 3rem;
}

/* Services Section */
.services-section {
    padding: 5rem 2rem;
    background-color: var(--secondary-bg);
    transition: var(--transition);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--gradient-primary), 0 8px 24px rgba(0, 102, 255, 0.2);
    border-color: var(--accent-color);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.service-card p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    flex-grow: 1;
    line-height: 1.5;
}

.service-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
    transition: var(--transition);
}

.service-card:hover .service-link {
    gap: 1rem;
}

/* Features Section */
.features-section {
    padding: 5rem 2rem;
    background-color: var(--primary-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Feedback Section */
.feedback-section {
    padding: 5rem 2rem;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
}

.feedback-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.feedback-form-wrapper,
.feedback-summary-wrapper {
    padding: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.feedback-form-wrapper h3,
.feedback-summary-wrapper h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}

.feedback-form-wrapper h4,
.feedback-summary-wrapper h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 2rem 0 1rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
}

.stars {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.stars i {
    font-size: 1.8rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
}

.stars i:hover,
.stars i.active {
    color: var(--warning-color);
    transform: scale(1.2) rotate(15deg);
}

.rating-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
}

.form-group textarea {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--hover-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: var(--transition);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.feedback-summary {
    text-align: center;
    padding: 2rem;
    background-color: var(--hover-bg);
    border-radius: 8px;
}

.average-rating {
    margin-bottom: 1.5rem;
}

.rating-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.average-stars {
    font-size: 2.5rem;
    color: var(--warning-color);
}

.average-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.total-ratings {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.feedback-list {
    margin-top: 2rem;
}

.feedback-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.feedback-items::-webkit-scrollbar {
    width: 6px;
}

.feedback-items::-webkit-scrollbar-track {
    background: var(--hover-bg);
    border-radius: 3px;
}

.feedback-items::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.feedback-items::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

.feedback-item {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: var(--transition);
}

.feedback-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.1);
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.feedback-item-stars {
    color: var(--warning-color);
    font-size: 1rem;
}

.feedback-item-comment {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    transition: var(--transition);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}

.footer-section h4 {
    color: var(--text-color);
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.footer-section p,
.footer-section ul {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.8;
}

.footer-section a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   IMPRESSUM.HTML STYLES
   ======================================== */
/* Impressum hat spezielle Body-Styles - kein Body-Selector für andere Seiten nötig */
.impressum {
    max-width: 900px;
    margin: 0 auto;
}
body.impressum {
    background-color: var(--secondary-bg);
}

body.impressum-page {
    margin: 0 auto;
    padding: 2rem 1rem;
    background-color: var(--secondary-bg);
    color: #222;
    line-height: 1.6;
}

body.impressum-page.dark-mode {
    color: var(--text-color);
}

body.impressum-page h1,
body.impressum-page h2 {
    color: #111;
}

body.impressum-page.dark-mode h1,
body.impressum-page.dark-mode h2 {
    color: var(--text-color);
}

body.impressum-page h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 1rem;
}

body.impressum-page h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    font-size: 1.5rem;
}

body.impressum-page p {
    margin: 0.5rem 0;
}

body.impressum-page a {
    color: #0056b3;
    text-decoration: none;
    word-wrap: break-word;
}

body.impressum-page a:hover {
    text-decoration: underline;
    color: #003d82;
}

body.impressum-page a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

body.impressum-page strong {
    font-weight: 600;
    color: #0056b3;
}

body.impressum-page.dark-mode strong {
    color: var(--accent-light);
}

.back-to-home {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    color: #000000;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

/* Extra bottom spacing for impressum page to separate from footer */
body.impressum-page .back-to-home {
    margin-bottom: 3.5rem;
}

.back-to-home:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
}

/* ========================================
   404.HTML STYLES
   ======================================== */
/* 404 hat spezielle Body-Styles */
body.page-404 {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

/* Training page specific styles */
.training-auth label, #createPlanSection label {
    display:block; margin-bottom:0.5rem;
}
.exercise-row { display:flex; gap:10px; align-items:flex-end; margin-bottom:0.5rem; flex-wrap:wrap; }
.exercise-row input { padding:6px 8px; border:1px solid var(--border-color); border-radius:6px; }
.exercise-table { width:100%; border-collapse:collapse; }
.exercise-table th, .exercise-table td { border:1px solid var(--border-color); padding:8px; text-align:left; }
.exercise-table input { padding:6px; border:1px solid var(--border-color); border-radius:6px; }

/* Specific widths for actual performance inputs (reps/weight) */
.exercise-table input.act-reps { width: 60px; }
.exercise-table input.act-weight { width: 90px; }

/* auth messages and small form tweaks */
.form-message { color: var(--text-secondary); margin: 0.5rem 0 1rem; min-height:1.2rem; }
.form-message.error { color: #c62828; }

/* Mobile-first adjustments */
@media (max-width: 600px) {
    .exercise-row { flex-direction: column; align-items: stretch; }
    .exercise-row label { width: 100%; }
    .btn { width: 100%; padding: 12px 16px; font-size: 1rem; }
    #exerciseTableWrap table, .exercise-table { font-size: 0.95rem; }
    .navbar-menu { gap: 0.5rem; flex-wrap:wrap; }
    .navbar-brand { font-size: 1.1rem; }
    .hero { padding: 2rem 1rem; }
}
@media (max-width: 460px) {
    .exercise-table input.act-reps { width: 40px; }
    .exercise-table input.act-weight { width: 65px; }
}
@media (max-width: 360px) {
    .exercise-table input.act-reps { width: 34px; }
    .exercise-table input.act-weight { width: 60px; }
}

/* Center the auth form nicely for desktop and mobile */
.training-auth {
    max-width: 720px;
    margin: 2rem auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.training-page main {
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

#loggedInPanel { display: flex; gap: 8px; align-items: center; justify-content: center; }
.training-auth form {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 0.65rem;
    margin: 0 auto;
}
.training-auth label input, .training-auth input[type='password'] {
    width: 100%;
    box-sizing: border-box;
}

/* Improve layout for the create plan / plan view on small screens */
#createPlanSection, #planViewSection, #plansSection { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }

/* Scale the exercise table slightly on narrow screens to fit in viewport - keep it readable */
@media (max-width: 460px) {
    #exerciseTableWrap { overflow-x: hidden; }
    .exercise-table {
        transform: scale(0.88);
        transform-origin: top left;
        width: calc(100% / 0.88);
    }
    .exercise-table th, .exercise-table td { padding: 6px; font-size: 0.85rem; }
}
@media (max-width: 460px) {
    #exerciseTableWrap { padding-left: 0.5rem; padding-right: 0.5rem; }
}

@media (max-width: 360px) {
    .exercise-table {
        transform: scale(0.82);
        width: calc(100% / 0.82);
    }
    .exercise-table th, .exercise-table td { padding: 5px; font-size: 0.8rem; }
}

body.page-404.dark-mode {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    color: #e8e8e8;
}

.container-404 {
    max-width: 600px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease-out;
}

body.page-404.dark-mode .container-404 {
    background: rgba(26, 31, 46, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

/* Ensure main container on 404 centers the .container-404 vertically */
body.page-404 main.container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

body.page-404 .button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

body.page-404 .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    text-align: center;
}

body.page-404 .btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

body.page-404 .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

body.page-404 .btn-primary:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

body.page-404 .btn-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

body.page-404.dark-mode .btn-secondary {
    color: var(--accent-light);
    border-color: var(--accent-light);
}

body.page-404 .btn-secondary:hover {
    background: rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

body.page-404 .btn-secondary:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

body.page-404 .quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* Ensure theme-toggle in 404 appears inline in the navbar (not fixed) */
body.page-404 .theme-toggle {
    position: static;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

body.page-404 .theme-toggle:hover {
    transform: scale(1.05);
}

body.page-404.dark-mode .theme-toggle {
    background: var(--accent-color);
    color: #fff;
}

body.page-404 .status-code {
    font-size: 0.9rem;
    color: #999;
    margin-top: 1rem;
}

/* 404 button improvements: larger padding and clearer contrast in light mode */
body.page-404 .quick-links .btn {
    padding: 0.9rem 1.25rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Use more neutral colors for secondary buttons on the 404 page in light mode */
body.page-404 .btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

body.page-404 .btn-secondary:hover {
    background: rgba(0,0,0,0.04);
}

body.page-404.dark-mode .status-code {
    color: #666;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .navbar-menu {
        width: 100%;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .services-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feedback-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .rating-display {
        flex-direction: row;
    }
    
    .average-stars,
    .average-number {
        font-size: 1.8rem;
    }
    
    body.impressum-page {
        padding: 1rem 0.5rem;
    }
    
    body.impressum-page h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    body.impressum-page h2 {
        font-size: 1.2rem;
    }
    
    body.page-404 .quick-links {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    body.page-404 .error-code {
        font-size: 4rem;
    }
    
    body.page-404 h1 {
        font-size: 1.5rem;
    }
    
    body.page-404 .container-404 {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    body.page-404 .button-group {
        flex-direction: column;
    }
    
    body.page-404 .btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .service-card,
    .feature-card,
    .feedback-form-wrapper,
    .feedback-summary-wrapper {
        padding: 1.5rem;
    }
    
    .services-section,
    .features-section,
    .feedback-section {
        padding: 3rem 1rem;
    }
    
    .stars {
        justify-content: center;
    }
    
    .stars i {
        font-size: 1.5rem;
    }
    
    .feedback-items {
        max-height: 300px;
    }
    
    .footer-content {
        gap: 1.5rem;
        padding: 2rem 0 1.5rem;
    }
}