* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #1a1a1a;
    color: #e0e0e0;
}

/* Navigation Menu */
.main-nav {
    background: #2a2a2a;
    border-bottom: 2px solid #3a3a3a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    font-size: 20px;
    font-weight: bold;
    color: #ff0080;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-logo:hover {
    color: #ff4081;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover {
    color: #ff0080;
    background: rgba(255, 0, 128, 0.1);
}

.nav-link.active {
    color: #ff0080;
    background: rgba(255, 0, 128, 0.2);
    font-weight: bold;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #ff0080;
}

.container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
}

/* Toolbar */
.toolbar {
    background: #2a2a2a;
    border-bottom: 2px solid #3a3a3a;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar h3 {
    color: #ff0080;
    margin: 0;
    font-size: 18px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    background: #3a3a3a;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: #4a4a4a;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.active {
    background: #ff0080;
    border-color: #ff4081;
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.5);
}

.btn.active:hover {
    background: #ff4081;
}

.btn-primary {
    background: linear-gradient(135deg, #ff0080, #ff4081);
    color: white;
    font-weight: bold;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff4081, #ff0080);
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background: #f44336;
}

/* Tool buttons */
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    position: relative;
}

.tool-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.tool-btn.active {
    background: #ff0080;
    border-color: #ff4081;
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.5);
}

.tool-btn.active:hover {
    background: #ff4081;
}

.tool-icon {
    font-size: 16px;
}

.toolbar h4 {
    color: #b0b0b0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    font-weight: 500;
}

/* Input fields */
label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #b0b0b0;
}

input[type="number"],
input[type="color"],
select {
    padding: 6px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 14px;
}

input[type="color"] {
    width: 50px;
    height: 35px;
    cursor: pointer;
    border: 2px solid #3a3a3a;
}

input[type="checkbox"] {
    cursor: pointer;
}

select {
    cursor: pointer;
    min-width: 150px;
}

/* Canvas */
canvas {
    flex: 1;
    background: #0a0a0a;
    cursor: crosshair;
    display: block;
}

canvas.panning {
    cursor: grab;
}

canvas.panning:active {
    cursor: grabbing;
}

/* Info panel */
.info-panel {
    position: absolute;
    top: 100px;
    right: 20px;
    background: rgba(42, 42, 42, 0.95);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.info-panel.visible {
    opacity: 1;
}

#hoverInfo {
    font-size: 13px;
    line-height: 1.6;
}

#hoverInfo strong {
    color: #ff0080;
}

/* Selection info */
.selection-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(42, 42, 42, 0.95);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    min-width: 250px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.selection-header h4 {
    margin: 0;
    color: #ff0080;
    font-size: 16px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid #3a3a3a;
    color: #b0b0b0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: #3a3a3a;
    color: white;
}

.selection-info.collapsed .selection-content {
    display: none;
}

#selectionDetails {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.8;
}

#selectionDetails div {
    margin: 4px 0;
}

/* Grid background effect */
canvas {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 12px;
    color: #555;
    z-index: 500;
    pointer-events: auto;
}

.app-footer a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}

.app-footer a:hover {
    color: #ff0080;
}

/* Responsive */
@media (max-width: 768px) {
    /* Menu - položky vedle sebe, kompaktní */
    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        padding: 5px 10px;
        gap: 10px;
    }

    .nav-logo {
        font-size: 18px;
    }

    .nav-menu {
        flex-direction: row;
        gap: 10px;
        width: auto;
        margin: 0;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 14px;
        width: auto;
        display: inline-block;
    }

    /* Toolbar - kompaktní */
    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 5px;
        gap: 5px;
        justify-content: center;
    }

    .toolbar-section {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 4px;
        margin: 0;
    }

    .toolbar h4 {
        display: none; /* Skrýt nadpis "Nástroje:" pro úsporu místa */
    }
    
    .btn, .tool-btn {
        padding: 6px 8px;
        font-size: 12px;
        height: 32px; /* Sjednocení výšky */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .tool-icon {
        font-size: 14px;
    }

    .toolbar input[type="number"],
    .toolbar input[type="color"],
    .toolbar select {
        padding: 4px;
        font-size: 12px;
        height: 30px;
    }
    
    .toolbar input[type="number"] {
        width: 50px;
    }
    
    .toolbar input[type="color"] {
        width: 35px;
        height: 30px;
    }

    .toolbar label {
        font-size: 12px;
        gap: 2px;
    }

    /* Info panely */
    .info-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 10px;
        top: auto;
        bottom: 80px; /* Nad selection info headerem */
        pointer-events: none;
    }

    /* Bottom sheet selection info */
    .selection-info {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none; /* Reset */
        border-radius: 15px 15px 0 0;
        border: 1px solid #3a3a3a;
        border-bottom: none;
        padding: 15px;
        z-index: 1000;
        background: #2a2a2a;
        transition: all 0.3s ease;
    }

    .selection-header {
        margin-bottom: 0;
        padding: 5px 0;
    }
    
    .selection-info:not(.collapsed) .selection-header {
        margin-bottom: 15px;
        border-bottom: 1px solid #3a3a3a;
        padding-bottom: 10px;
    }

    .page-content {
        padding: 15px;
    }

    .page-content h1 {
        font-size: 24px;
    }

    .app-footer {
        display: none;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Page Content */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: #1a1a1a;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.page-content h1 {
    color: #ff0080;
    font-size: 36px;
    margin-bottom: 30px;
    text-align: center;
}

.elwire-description {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 30px;
    line-height: 1.8;
    font-size: 16px;
    color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.elwire-description p {
    margin-bottom: 15px;
}

.elwire-description h2,
.elwire-description h3 {
    color: #ff0080;
    margin-top: 30px;
    margin-bottom: 15px;
}

.elwire-description h2 {
    font-size: 24px;
}

.elwire-description h3 {
    font-size: 20px;
}

.elwire-description a {
    color: #ff0080;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 0, 128, 0.3);
    transition: all 0.3s;
}

.elwire-description a:hover {
    color: #ff4081;
    border-bottom-color: #ff4081;
}

.elwire-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.elwire-description ul,
.elwire-description ol {
    margin: 15px 0;
    padding-left: 30px;
}

.elwire-description li {
    margin: 8px 0;
}

.elwire-description blockquote {
    border-left: 4px solid #ff0080;
    padding-left: 20px;
    margin: 20px 0;
    color: #b0b0b0;
    font-style: italic;
}

.elwire-description code {
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #ff4081;
}

.elwire-description pre {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.elwire-description pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
}

.elwire-description strong {
    color: #ff0080;
    font-weight: bold;
}

.elwire-description em {
    color: #b0b0b0;
    font-style: italic;
}

/* Print styles */
@media print {
    /* Hide all UI elements */
    .toolbar,
    .info-panel,
    .selection-info,
    .main-nav { /* Přidáno skrytí navigace */
        display: none !important;
    }

    /* Make body and container fill the page */
    body {
        background: white;
        overflow: visible;
        width: 100%;
        height: 100%;
    }

    .container {
        height: auto;
        min-height: 100vh;
        display: block; /* Změna z flex na block */
    }

    /* Canvas fills the page while maintaining aspect ratio */
    canvas {
        position: static !important; /* Aby se respektoval tok dokumentu */
        width: 100% !important;
        height: auto !important; /* Zachování poměru stran */
        max-height: 100vh; /* Aby se vešel na stránku */
        background: white !important;
        background-image: none !important;
        display: block;
        margin: 0 auto; /* Centrování */
    }

    /* Optimize for printing */
    @page {
        size: landscape; /* Automaticky landscape, bez fixní A4 pro flexibilitu */
        margin: 0; /* Minimalizace okrajů prohlížeče */
    }

    /* Remove any shadows or effects that don't print well */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}
