/* MOBILE-FIRST RESPONSIVE CSS - OPTIMIZED FOR ALL DEVICES */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Century Gothic', 'Trebuchet MS', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

.lcp-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 60vh;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #F35459;
    outline-offset: 2px;
}

/* Skip to main content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #F35459;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* MOBILE-FIRST LAYOUT */
#page {
    width: 100%;
    max-width: 1550px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER - MOBILE FIRST */
header {
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
/*    position: sticky;
    top: 0;*/
    z-index: 100;
}

h1 {
    margin: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    font-size: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
    color: #333;
}

.trinact {
    color: #F35459;
}

/* NAVIGATION - MOBILE FIRST */
nav {
    margin-top: 1rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

nav li {
    border-radius: 8px;
    overflow: hidden;
}

nav a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: #333;
    background-color: #f8f9fa;
    text-align: center;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch target */
}

nav a:hover,
nav a:focus,
.aktivni a {
    background-color: #F35459;
    color: white;
    transform: translateY(-2px);
}

/* MAIN CONTENT */
main {
    flex: 1;
}

/* HERO BANNER */
.hero-banner {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                url('img/banner.webp') center/cover;
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-weight: bold;
}

/* INDEX PAGE - MOBILE FIRST */
.uvod {

    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    overflow: hidden;    

    /*background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), 
                url("img/house.webp") center/cover;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;*/
}

.uvod::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3),
    rgba(0,0,0,0.3));
    pointer-events: none;
    z-index: 1;
}

aside {
    background-color: #F35459;
    padding: 2rem 1rem;
    color: white;
    margin-bottom: 2rem;
}

.text {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    text-align: justify;
}

.text span {
    color: #000;
    font-weight: bold;
}

.slogan {
    color: #000;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-family: 'Century Gothic', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    text-align: center;
    margin: 2rem 0;
}

/* SERVICES SECTION */
.co_nabizime {
    padding: 2rem 1rem;
    background-color: #fff;
}

.co_nabizime h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
}

.services-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.levy_panel,
.stredni_panel,
.pravy_panel {
    border: 2px dashed #F35459;
    padding: 1.5rem;
    border-radius: 12px;
    background-color: #fafafa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.levy_panel:hover,
.stredni_panel:hover,
.pravy_panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(243,84,89,0.15);
}

.levy_panel h3,
.stredni_panel h3,
.pravy_panel h3 {
    color: #F35459;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* CONTACT SECTION */
.aktuality {
    background-color: #f8f9fa;
    padding: 2rem 1rem;
    text-align: center;
}

.aktuality h3 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
}

.contact-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.oteviraci_doba table {
    width: 100%;
    border-collapse: collapse;
    background-color: #f8f9fa;
}

.oteviraci_doba td {
    padding: 0.75rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
}

.ak_sloupec a {
    color: #F35459;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.ak_sloupec a:hover {
    text-decoration: underline;
}

.ak_sloupec {
    text-align: center;
}

.ak_sloupec table {
    margin: 0 auto; /* center the table itself */
}

.ak_sloupec td {
    vertical-align: middle;
    padding: 10px;
}

/* SUBPAGES STYLES - MOBILE FIRST */
.service-content,
.pricing-content,
.estimate-content,
.price-types-content,
.contact-content {
    padding: 1rem;
}

.service-description,
.usage-scenarios,
.pricing-table,
.equipment-info,
.price-explanation {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.text-content {
    order: 1;
}

.service-image,
.pricing-image,
.equipment-image,
.price-image {
    order: 2;
    text-align: center;
}

.text-content h3 {
    color: #F35459;
    font-size: clamp(1.3rem, 4vw, 2rem);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.services-list,
.equipment-list,
.price-types-list {
    padding-left: 1rem;
}

.services-list li,
.equipment-list li,
.price-types-list li {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.services-list strong,
.equipment-list strong,
.price-types-list strong {
    color: #F35459;
}

/* PRICING TABLE */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.price-table thead,
.price-table tbody {
    display: table;
    width: 100%;
}

.price-table th,
.price-table td {
    border: 1px solid #ddd;
    padding: 1rem 0.5rem;
    text-align: left;
    white-space: normal;
    width: 33.33%; /* Equal width for 3 columns */
    word-wrap: break-word;  /* Prevents overflow in fixed layout */
}

.price-table th {
    background-color: #F35459;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.price-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.pricing-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #F35459;
    margin-top: 2rem;
}

.pricing-info h4 {
    color: #F35459;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* CONTACT PAGE */
.contact-info {
    display: grid;
    gap: 2rem;
}

.address-section h3,
.contact-details h3,
.contact-form h3 {
    color: #F35459;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 1rem;
}

.map-container {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-container iframe {
    width: 100%;
    height: 250px;
    border: 0;
}

.person-contact {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid #F35459;
}

.person-contact h4 {
    color: #F35459;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.social-links img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.social-links img:hover {
    transform: scale(1.1);
}

/* CONTACT FORM */
.contact-form-element {
    display: grid;
    gap: 1rem;
}

.contact-form-element label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.contact-form-element input,
.contact-form-element select,
.contact-form-element textarea {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 44px; /* Touch target */
}

.contact-form-element input:focus,
.contact-form-element select:focus,
.contact-form-element textarea:focus {
    border-color: #F35459;
    box-shadow: 0 0 0 3px rgba(243,84,89,0.1);
}

.contact-form-element textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-form-element button {
    background-color: #F35459;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.contact-form-element button:hover,
.contact-form-element button:focus {
    background-color: #d63038;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243,84,89,0.3);
}

/* IMAGES */
img {
    max-width: 100%;
    height: auto;
    border: 0;
    border-radius: 8px;
}

/* FOOTER */
footer {
    background-color: #F35459;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    color: #333;
}

/* UTILITY CLASSES */
.clear {
    display: none; /* Not needed with modern layout */
}

/* TABLET BREAKPOINT (768px) */
@media screen and (min-width: 48rem) {
    header {
        padding: 1.5rem 2rem;
    }
    
    h1 {
        text-align: left;
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
    
    nav {
        margin-top: 1rem;
    }
    
    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    nav li {
        flex: 1;
        min-width: 140px;
        max-width: 180px;
    }
    
    .hero-banner {
        padding: 4rem 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-info {
        grid-template-columns: 1fr 1fr;
    }
    
    .service-content,
    .pricing-content,
    .estimate-content,
    .price-types-content,
    .contact-content {
        padding: 2rem;
    }
    
    .map-container iframe {
        height: 300px;
    }
    
    .price-table {
        font-size: 1rem;
        display: table;
        white-space: normal;
    }
}

/* DESKTOP BREAKPOINT (1024px) */
@media screen and (min-width: 64rem) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2rem;
        height: 100px;
    }
    
    h1 {
        margin: 0;
    }
    
    nav {
        margin: 0;
    }
    
    nav ul {
        flex-wrap: nowrap;
    }
    
    nav li {
        min-width: 160px;
    }
    
    nav a {
        padding: 1.5rem 1rem;
        font-size: 1rem;
    }
    
    .hero-banner {
        padding: 5rem 2rem;
    }
    
    /* INDEX PAGE DESKTOP LAYOUT */
    .index-layout {
        display: grid;
        grid-template-areas: 
            "aside uvod"
            "services services"
            "contact contact";
        grid-template-columns: 30% 70%;
        gap: 0;
    }
    
    aside {
        grid-area: aside;
        margin: 0;
        padding: 3rem 2rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .uvod {
        grid-area: uvod;
        margin: 0;
        min-height: 650px;
    }
    
    .co_nabizime {
        grid-area: services;
        padding: 3rem 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .aktuality {
        grid-area: contact;
        padding: 3rem 2rem;
    }
    
    .contact-grid {
        grid-template-columns: auto 1fr;
        align-items: start;
    }
    
    /* SUBPAGES DESKTOP LAYOUT */
    .service-description,
    .usage-scenarios,
    .pricing-table,
    .equipment-info,
    .price-explanation {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .text-content {
        flex: 2;
        order: 1;
        padding-right: 2rem;
    }
    
    .service-image,
    .pricing-image,
    .equipment-image,
    .price-image {
        flex: 1;
        order: 2;
    }
    
    .contact-info {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 3rem;
    }
    
    .map-container iframe {
        height: 353px;
    }
    
    .service-content,
    .pricing-content,
    .estimate-content,
    .price-types-content,
    .contact-content {
        padding: 3rem;
    }
}

/* LARGE DESKTOP (1400px+) */
@media screen and (min-width: 87.5rem) {
    .service-content,
    .pricing-content,
    .estimate-content,
    .price-types-content,
    .contact-content {
        padding: 4rem;
    }
    
    .services-grid {
        max-width: 1200px;
        margin: 2rem auto;
    }
}

/* HIGH DPI DISPLAYS */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .hero-banner {
        background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                         url('img/banner@2x.webp');
    }
}

/* PRINT STYLES */
@media print {
    header nav,
    .hero-banner,
    .contact-form,
    .social-links {
        display: none;
    }
    
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    .price-table {
        page-break-inside: avoid;
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --card-bg: #2d2d2d;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .levy_panel,
    .stredni_panel,
    .pravy_panel,
    .person-contact,
    .pricing-info {
        background-color: var(--card-bg);
        color: var(--text-color);
    }
    
    .locations-table tr, 
    .contact-form-element label,
    .person-contact a {
      background-color: #1e1e1e;
      color: #e0e0e0;
    }

    .locations-table td {
     border: none;
    }

    .price-table th {
        background-color: #F35459;
    }

    .social-links {
     background-color: white;
    }
    .price-table tr:nth-child(even)
     {
        background-color: var(--card-bg);
    }
}