/* Grundstruktur */
html, body {
    font-family: Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Header fixiert */
header {
    position: fixed;
    top: 30px; /* Breadcrumb-Höhe */
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

/* Canvas-Container */
#canvas-container {
    position: fixed;
    top: 100px; /* Header-Höhe + Breadcrumb-Höhe */
    left: 0;
    right: 0;
    bottom: 80px; /* Controls-Höhe */
    overflow: hidden;
}

#mainCanvas {
    width: 100%;
    height: 100%;
}

/* Controls absolut am unteren Rand fixiert */
.controls-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: white;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px;
    box-sizing: border-box;
}

/* Control-Gruppen Styles */
.control-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 5px 0;
}

.control-group label {
    min-width: 140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-group input[type="range"] {
    flex: 1;
    height: 20px;
    margin: 0 10px;
}

#rotationValue {
    min-width: 40px;
    text-align: right;
}

/* Button Styles */
.button {
    border: none;
    color: white;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px;
    cursor: pointer;
    border-radius: 4px;
    min-width: 100px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spezifische Button-Farben */
#openInstructions {
    background-color: #2196F3; /* Blau */
}


#importSurface {
    background-color: #FFA000; /* Dunkelgelb */
}

#importTemplate {
    background-color: #FF5722; /* Orange */
}

#lockSettings {
    background-color: #00BCD4; /* Eisblau */
}

#saveButton {
    background-color: #D32F2F; /* Rotton */
}

/* Hover-Effekte für bessere Interaktivität */
.button:hover {
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.button-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.template-controls {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid #ddd;
}

/* MODAL STYLES DISABLED - Now using hamburger menu instead */

/* BREADCRUMB STYLES DISABLED - Now using hamburger menu instead */
/*
body .breadcrumb {
    background-color: #f8f9fa !important;
    padding: 10px 0 !important;
}

body .breadcrumb ul {
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

body .breadcrumb li {
    margin: 0 10px !important;
}

body .breadcrumb a {
    text-decoration: none !important;
    color: #6c757d !important;
    font-weight: bold !important;
}

body .breadcrumb a.active {
    color: #007bff !important;
}

body .breadcrumb a:hover {
    text-decoration: underline !important;
}

.breadcrumb {
    background-color: #f8f9fa !important;
    padding: 10px 0 !important;
}

.breadcrumb ul {
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.breadcrumb li {
    margin: 0 10px;
}

.breadcrumb a {
    text-decoration: none;
    color: #6c757d;
    font-weight: bold;
}

.breadcrumb a.active {
    color: #007bff;
}

.breadcrumb a:hover {
    text-decoration: underline;
}
*/

/* Mobile Anpassungen */
@media (max-width: 768px) {
    /* Header für Mobile */
    header {
        height: 50px; /* Reduzierte Höhe */
        padding: 4px;
        gap: 5px;
    }

    /* Logo kleiner für Mobile */
    header img.logo {
        height: 40px;
        width: auto;
    }

    /* Canvas-Container Anpassung */
    #canvas-container {
        top: 80px; /* Angepasst an kleineren Header */
        bottom: 160px; /* Mehr Platz für Controls */
    }

    /* Controls-Container für Mobile */
    .controls-container {
        height: 160px; /* Mehr Höhe für gestapelte Elemente */
        padding: 4px;
        grid-template-columns: 1fr; /* Einspaltiges Layout */
        gap: 2px;
        overflow-y: auto; /* Scrollbar wenn nötig */
    }

    /* Kompaktere Buttons */
    .button {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 70px;
        max-width: 100px;
        margin: 2px;
    }

    /* Button-Gruppe kompakter */
    .button-group {
        gap: 2px;
        justify-content: center;
    }

    /* Control-Gruppen kompakter */
    .control-group {
        margin: 2px 0;
        gap: 2px;
    }

    .control-group label {
        min-width: 100px; /* Schmaler für Mobile */
        font-size: 12px;
    }

    .control-group input[type="range"] {
        margin: 0 5px;
    }

    /* Modal anpassen */
    .modal-content {
        margin: 2% auto;
        padding: 10px;
        width: 95%;
        max-height: 90vh;
    }

    /* Breadcrumb kompakter */
    .breadcrumb {
        padding: 5px 0 !important;
    }

    .breadcrumb li {
        margin: 0 5px !important;
        font-size: 12px;
    }
}

/* Zusätzliche Anpassungen für sehr kleine Bildschirme */
@media (max-width: 320px) {
    .controls-container {
        height: 180px; /* Noch mehr Höhe wenn nötig */
    }

    #canvas-container {
        bottom: 180px;
    }

    .button {
        font-size: 11px;
        padding: 4px 6px;
        min-width: 60px;
    }
}

/* Hamburger Menu Styles */
.hamburger-button {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    background: none !important;
    color: black !important;
}

.hamburger-button:hover {
    opacity: 1 !important;
    box-shadow: none !important;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 18px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-button.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-button.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #ff6b35;
    color: white;
}

.mobile-menu-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.close-menu-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-menu-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-content {
    padding: 0;
}

/* PWA Installation Section */
.pwa-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin: 10px;
    color: white;
}

.pwa-section h3 {
    color: white !important;
    background: rgba(255,255,255,0.1);
    margin: 0;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
}

.pwa-content {
    padding: 15px 20px 20px 20px;
}

.pwa-content p {
    margin: 8px 0;
    line-height: 1.4;
}

.pwa-benefits {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.pwa-benefits li {
    padding: 4px 0;
    font-size: 14px;
}

.pwa-instructions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.pwa-instructions p {
    margin: 6px 0;
    font-size: 13px;
}

/* Language Selection */
.language-section {
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px;
}

.language-section h3 {
    background: #e9ecef;
    margin: 0;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    color: #495057;
    font-size: 14px;
}

.language-selector {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    background: white;
    border: 2px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 120px;
}

.lang-btn:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.lang-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Flag-based language selector */
.lang-flag {
    background: transparent;
    border: 2px solid transparent;
    padding: 8px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.lang-flag[data-lang="en"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23B22234"/><path d="M0,3.5h60M0,7h60M0,10.5h60M0,14h60M0,17.5h60M0,21h60M0,24.5h60M0,28h60" stroke="%23FFF" stroke-width="2"/><rect width="24" height="17" fill="%233C3B6E"/><g fill="%23FFF"><circle cx="6" cy="3" r="1"/><circle cx="12" cy="3" r="1"/><circle cx="18" cy="3" r="1"/><circle cx="6" cy="7" r="1"/><circle cx="12" cy="7" r="1"/><circle cx="18" cy="7" r="1"/><circle cx="6" cy="11" r="1"/><circle cx="12" cy="11" r="1"/><circle cx="18" cy="11" r="1"/><circle cx="6" cy="15" r="1"/><circle cx="12" cy="15" r="1"/><circle cx="18" cy="15" r="1"/></g></svg>');
    background-size: 30px 20px;
    background-repeat: no-repeat;
    background-position: center;
}

.lang-flag[data-lang="de"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><rect width="60" height="13.33" fill="%23000"/><rect y="13.33" width="60" height="13.33" fill="%23DD0000"/><rect y="26.67" width="60" height="13.33" fill="%23FFCE00"/></svg>');
    background-size: 30px 20px;
    background-repeat: no-repeat;
    background-position: center;
}

.lang-flag:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    transform: scale(1.1);
}

.lang-flag.active {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.lang-flag[data-lang="en"]:hover,
.lang-flag[data-lang="en"].active {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23B22234"/><path d="M0,3.5h60M0,7h60M0,10.5h60M0,14h60M0,17.5h60M0,21h60M0,24.5h60M0,28h60" stroke="%23FFF" stroke-width="2"/><rect width="24" height="17" fill="%233C3B6E"/><g fill="%23FFF"><circle cx="6" cy="3" r="1"/><circle cx="12" cy="3" r="1"/><circle cx="18" cy="3" r="1"/><circle cx="6" cy="7" r="1"/><circle cx="12" cy="7" r="1"/><circle cx="18" cy="7" r="1"/><circle cx="6" cy="11" r="1"/><circle cx="12" cy="11" r="1"/><circle cx="18" cy="11" r="1"/><circle cx="6" cy="15" r="1"/><circle cx="12" cy="15" r="1"/><circle cx="18" cy="15" r="1"/></g></svg>');
    background-size: 30px 20px;
}

.lang-flag[data-lang="de"]:hover,
.lang-flag[data-lang="de"].active {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><rect width="60" height="13.33" fill="%23000"/><rect y="13.33" width="60" height="13.33" fill="%23DD0000"/><rect y="26.67" width="60" height="13.33" fill="%23FFCE00"/></svg>');
}

.menu-section {
    border-bottom: 1px solid #eee;
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-section h3 {
    margin: 0;
    padding: 15px 20px 10px 20px;
    font-size: 1.1em;
    color: #333;
    background: #f8f9fa;
}

.menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-links li {
    border-bottom: 1px solid #f0f0f0;
}

.menu-links li:last-child {
    border-bottom: none;
}

.menu-links a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #495057;
    transition: background-color 0.2s ease;
}

.menu-links a:hover {
    background-color: #f8f9fa;
}

.menu-links a.active {
    background-color: #fff3e0;
    color: #e65100;
    font-weight: 500;
}

.quick-reference {
    padding: 10px 20px 20px 20px;
}

.reference-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 0.9em;
    border-left: 3px solid #ff6b35;
}

.instructions-content {
    padding: 10px 20px 20px 20px;
}

.instruction-step {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.instruction-step strong {
    color: #e65100;
}

.about-content {
    padding: 10px 20px 20px 20px;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.5;
}

.about-content a {
    color: #ff6b35;
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

.privacy-note {
    margin-top: 15px;
    font-size: 0.8em;
    color: #868e96;
    text-align: center;
    font-style: italic;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        right: -100%;
    }
    
    .hamburger-button .button-text {
        display: none;
    }
}

/* Downloads Modal Styles */
.downloads-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.downloads-modal.open {
    opacity: 1;
    visibility: visible;
}

.downloads-modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.downloads-modal-header {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.downloads-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.close-modal-button {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.downloads-modal-body {
    padding: 30px;
}

.downloads-intro {
    text-align: center;
    margin-bottom: 30px;
}

.downloads-intro p {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    line-height: 1.6;
}

.software-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.software-list li {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e9ecef;
    font-weight: 500;
}

.downloads-note {
    font-weight: 600;
    color: #1565C0;
    margin-top: 20px !important;
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.download-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.download-item:hover {
    border-color: #1565C0;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.15);
    transform: translateY(-2px);
}

.download-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.download-info {
    flex-grow: 1;
}

.download-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.download-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.asebutton {
    background-color: #1565C0;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    line-height: 1;
    border: none;
    cursor: pointer;
    width: fit-content;
    justify-content: center;
}

.asebutton:hover {
    background-color: #0D47A1;
}

.downloads-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.downloads-help {
    color: #666;
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
}

.downloads-help strong {
    color: #333;
}

/* Modal Overlay Base Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness for Downloads Modal */
@media (max-width: 768px) {
    .downloads-modal {
        padding: 10px;
    }
    
    .downloads-modal-header {
        padding: 15px 20px;
    }
    
    .downloads-modal-header h2 {
        font-size: 1.2em;
    }
    
    .downloads-modal-body {
        padding: 20px;
    }
    
    .downloads-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .download-item {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .software-list {
        flex-direction: column;
        align-items: center;
    }
    
    .downloads-intro p {
        font-size: 1em;
    }
}