/* ZÁKLADNÍ STYLY PRO NÁSTROJE - zjednodušená verze */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --radius: 12px;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

/* Canvas */
#background-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}

/* Hlavní kontejner */
.tool-app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.tool-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.tool-title {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text-light);
}

/* Karta */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

/* Textarea */
.modern-textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: monospace;
    font-size: 16px;
    resize: vertical;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tlačítka */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* Skupina tlačítek */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Output sekce */
.output-content {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-app-container {
        padding: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* ===== MODERNÍ EFEKTY CAUAHOJ.XYZ ===== */

/* Glassmorphism efekt pro karty */
.card-glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glass:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 
        0 12px 48px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Moderní textarea s gradient border */
.modern-textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    transition: all 0.3s;
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)),
        linear-gradient(135deg, #3b82f6, #8b5cf6);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.modern-textarea:focus {
    outline: none;
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
        linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 4px 20px rgba(59, 130, 246, 0.2);
}

/* Moderní tlačítka s gradientem */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 500;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Elegantní záhlaví */
.tool-header {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.9) 0%, 
        rgba(30, 41, 59, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: -20px -20px 30px -20px;
    padding: 25px 30px;
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(59, 130, 246, 0.5), 
        transparent);
}

.tool-title {
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

/* Back button s ikonou */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: 25px;
}

.back-button:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Výsledková oblast s animací */
.output-content {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 15px;
    line-height: 1.7;
    color: #dbeafe;
    border: 1px solid rgba(59, 130, 246, 0.1);
    animation: fadeIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.output-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status indikátory */
#charCount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #93c5fd;
}

/* Action buttons container */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

/* Responsivní vylepšení */
@media (max-width: 768px) {
    .tool-app-container {
        padding: 16px;
    }
    
    .tool-title {
        font-size: 2rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .card-glass {
        padding: 20px;
    }
    
    .modern-textarea {
        padding: 16px;
        font-size: 15px;
    }
}

/* Micro-interactions */
#pasteBtn {
    transition: all 0.2s;
}

#pasteBtn:hover {
    color: #60a5fa;
    transform: scale(1.05);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #4f46e5);
}

/* ===== OPRAVY PRO CANVAS A LAYOUT ===== */

/* Oprava canvasu - musí být ZA obsah */
#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -9999; /* ZA vším */
    pointer-events: none;
    display: block;
}

/* Hlavní kontejner - před canvasem */
.tool-app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1; /* PŘED canvasem */
    background: transparent; /* Průhledné pozadí */
}

/* Oprava pro karty - průhledné pozadí s blur efektem */
.card-glass {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 2;
}

/* Oprava pro header */
.tool-header {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

/* Oprava pro textarea - neprůhledné */
.modern-textarea {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 2px solid var(--border) !important;
    backdrop-filter: blur(10px);
}

/* Oprava pro select a input */
select, input[type="number"], input[type="text"] {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
}

/* Oprava pro výstup */
.output-content {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
}

/* Oprava pro tabulku */
.conversion-table {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Oprava pro tlačítka kategorií */
.category-btn {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
}

/* Oprava pro footer */
footer {
    position: relative;
    z-index: 2;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    margin-top: 40px;
    padding: 30px !important;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Zajistit, že vše je před canvasem */
main, section, div[class*="card"], div[class*="container"] {
    position: relative;
    z-index: 1;
}

/* Oprava pro overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    min-height: 100vh;
    position: relative;
}

/* Oprava pro Unit Converter specifické elementy */
.converter-field {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px);
}

.quick-conversion-item {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(10px);
}

/* Oprava pro světlý režim */
[data-theme="light"] .card-glass,
[data-theme="light"] .tool-header,
[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="light"] .modern-textarea,
[data-theme="light"] select,
[data-theme="light"] input,
[data-theme="light"] .output-content,
[data-theme="light"] .converter-field,
[data-theme="light"] .quick-conversion-item {
    background: rgba(255, 255, 255, 0.9) !important;
}

/* Oprava scrollbaru pro obsah */
.tool-app-container {
    min-height: 100vh;
}

/* Oprava pro mobilní zobrazení */
@media (max-width: 768px) {
    .tool-app-container {
        padding: 15px;
    }
    
    .card-glass, .tool-header {
        padding: 20px;
    }
    
    /* Snížit blur na mobilech pro lepší výkon */
    .card-glass, .tool-header, footer {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ===== ZAKULACENÉ OKNA - MODERNÍ DESIGN ===== */

/* Všechny karty a kontejnery */
.card-glass,
.tool-header,
.tool-app-container,
.input-group,
.output-group,
.converter-field,
.unit-converter,
.calculator-inputs,
.mode-selector,
.category-selector,
.quick-conversions,
.conversion-table,
.real-life-examples,
.example-item,
.quick-conversion-row,
.converter-row {
    border-radius: 20px !important;
}

/* Tlačítka */
.btn-primary,
.btn-secondary,
.btn-small,
.btn-large,
.btn-micro,
.category-btn,
.mode-btn,
.quick-value-btn,
.quick-use-btn,
.action-btn,
.theme-toggle,
.back-button,
.cta-button,
.mobile-menu-button,
.back-to-top,
.mobile-nav-close {
    border-radius: 16px !important;
}

/* Inputy, selecty, textarea */
.modern-textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
.unit-select,
.precision-select {
    border-radius: 14px !important;
}

/* Speciální zakulacení pro výstupní oblasti */
.output-content {
    border-radius: 18px !important;
    border-top-left-radius: 4px !important;
}

/* Tabulky */
table {
    border-radius: 16px !important;
    overflow: hidden !important;
}

th:first-child {
    border-top-left-radius: 16px !important;
}

th:last-child {
    border-top-right-radius: 16px !important;
}

/* Notification */
.notification {
    border-radius: 16px !important;
}

/* Mobile overlay */
.mobile-nav-overlay .mobile-nav-content {
    border-radius: 0 0 0 30px !important;
}

/* Speciální zakulacení pro ikony */
.card-icon,
.feature-icon,
.tool-icon-wrapper,
.example-icon {
    border-radius: 18px !important;
}

/* Badges a tagy */
.card-tag,
.tech-badge {
    border-radius: 20px !important;
}

/* Progress bars a range inputs */
input[type="range"] {
    border-radius: 10px !important;
}

/* QR code preview */
.qr-preview {
    border-radius: 20px !important;
}

/* Form groups */
.form-group {
    border-radius: 18px !important;
}

/* Tabs */
.tabs {
    border-radius: 14px !important;
}

.tab {
    border-radius: 10px !important;
}

/* Special - ještě víc zakulacení pro hlavní prvky */
.main-container,
.app-header,
.hero-section,
.tools-section,
.features-section,
.cta-section,
.main-footer {
    border-radius: 24px !important;
}

/* Tool cards na hlavní stránce */
.tool-card {
    border-radius: 24px !important;
}

.tool-card::before {
    border-radius: 24px 24px 0 0 !important;
}

/* Feature cards */
.feature-card {
    border-radius: 24px !important;
}

/* CTA section */
.cta-section .cta-content {
    border-radius: 24px !important;
}

/* Footer sections */
.footer-section {
    border-radius: 20px !important;
}

/* Canvas pozadí - lehce zakulacené rohy (volitelné) */
#background-canvas {
    border-radius: 0 !important; /* Canvas zůstane hranatý */
}

/* Responsivní zakulacení */
@media (max-width: 768px) {
    .card-glass,
    .tool-header {
        border-radius: 18px !important;
    }
    
    .btn-primary,
    .btn-secondary {
        border-radius: 14px !important;
    }
    
    .tool-card {
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {
    .card-glass,
    .tool-header {
        border-radius: 16px !important;
    }
    
    .modern-textarea,
    input,
    select {
        border-radius: 12px !important;
    }
}