:root {
    --primary-color: #00a1ff;
    --white: #ffffff;
    --dark-gray: #333333;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--white);
    color: var(--dark-gray);
}

/* Navigation Menu */
.main-nav {
    background-color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
}

.nav-links a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: width 0.3s;
}

.nav-links a:hover:after, .nav-links a.active:after {
    width: 100%;
}

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

h1, h2, h3 {
    color: var(--primary-color);
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Page handling for the calculator pages */
.page {
    display: block;
}

#results-page {
    display: none;
}

.input-page {
    /* max-width: 100px; */
    width: 100%;
    padding: 1rem 0.5rem;
    align-items: center;
}

/* Two-column layout */
.two-column-layout {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
    align-items: center;
}

.left-column, .right-column {
    flex: 1;
}

.right-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Input Section */
.input-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#calculate-btn {
    display: block;
    margin: 2rem auto 0 auto;
    max-width: 500px;
    margin-bottom: 8rem;
}


.large-input {
    width: 100%;
    padding: 1rem;
    border: 0.15rem solid var(--primary-color) !important;
    border-radius: 30px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    /* Remove spinner buttons */
    appearance: textfield;
    -moz-appearance: textfield;
}

.large-input::-webkit-outer-spin-button,
.large-input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.allocation-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.allocation-input {
    width: 80px;
    padding: 0.5rem;
    border: 0.15rem solid var(--primary-color);
    border-radius: 30px;
    font-size: 1rem;
    text-align: center;
    /* Remove spinner buttons */
    appearance: textfield;
    -moz-appearance: textfield;
}

.allocation-input::-webkit-outer-spin-button,
.allocation-input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.allocation-total {
    text-align: right;
    font-weight: bold;
    margin-top: -5vh;
}

/* Chart Section */
.chart-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: none;
    height: 100%;
}

.chart-container {
    margin-top: 2rem;
    height: 300px;
    position: relative;
}

/* Button Styles */
button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 1rem;
}

button:hover {
    background-color: #0080cc;
}

.info-btn {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 30px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: auto;
  margin-top: 0;
  margin-bottom: 0;
  width: auto;
  display: inline-block;
}
.info-btn:hover {
  background-color: #0080cc;
}

/* Results Page */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header button {
    width: auto;
    margin-top: 0;
}

/* Custom DIP overlay */
.custom-dip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}
.custom-dip-container {
    background: #fff;
    width: 90%;
    max-width: 50vw;
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
}
.custom-dip-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    width: auto;
    margin: 0;
    padding: 0.25rem 0.5rem;
    color: var(--dark-gray);
    font-size: 1.5rem;
}
.custom-dip-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
}
.custom-dip-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.custom-dip-grid input, .custom-dip-grid select {
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
}
.custom-dip-grid input::-webkit-outer-spin-button,
.custom-dip-grid input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}
.custom-dip-grid input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}
.currency-row {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .custom-dip-grid { grid-template-columns: 1fr; }
}

/* How-to section */
.howto-section { padding-top: 0; }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 15vh;
}
.step-card {
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}
.step-icon { width: 60px; height: 60px; margin: 0 auto 0.5rem auto; border-radius: 50%; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.step-icon img { max-width: 100%; max-height: 100%; display:block; }
@media (max-width: 900px) { .steps-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps-grid { grid-template-columns: 1fr; } }

.results-container {
    margin-bottom: 2rem;
}

/* Result Card - New Styles */
.result-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: left;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.result-card.best {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 161, 255, 0.2);
}

.result-card-header {
    display: none; /* Hide original header as we integrate it */
}

.result-card-body {
    display: flex;
    justify-content: space-between;
    align-items: left;
    width: 100%;
}

.result-card-section {
    flex: 1;
    display: flex;
    align-items: left;
}

.result-card-section:first-child {
    flex: 2; /* Give more space to the provider info */
}

.result-card-section h4 {
    display: none; /* Hide the titles like "Celková částka" */
}

.result-card-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-gray);
}

.result-card-value-section {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.result-card-details {
    margin-left: 20px;
    text-align: left;
}

.result-card-final-amount, .result-card-return {
    margin: 0;
    padding: 0;
    text-align: right;
}

.result-card-final-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-gray);
}

.result-card-return {
    color: #666;
    font-size: 0.9rem;
}

.result-card-footer {
    display: none; /* Hide the footer with buttons for a cleaner look like the image */
}


/* Provider Cards */
.provider-card {
    display: flex;
    justify-content: space-between;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.provider-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(244, 221, 221, 0.1);
}

.provider-card.best {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 161, 255, 0.2);
}

.provider-left {
    display: flex;
    align-items: center;
    flex: 2;
}

.provider-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.provider-logo {
    width: 120px;
    height: 60px;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.provider-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.provider-info {
    flex: 1;
}

.provider-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
}

.provider-result {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: bold;
}

.provider-details {
    color: #666;
    font-size: 0.9rem;
}

/* Providers List */
.providers-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin: 0 auto;
    max-width: 90vw;
}

/* Media Queries */
@media (max-width: 768px) {
    .provider-card {
        flex-direction: column;
        text-align: center;
    }

    .provider-left, .provider-right {
        flex-direction: column;
        align-items: center;
    }

    .result-card-logo {
      width: 80px;
      height: 80px;
      margin-right: 20px;
      object-fit: contain;
      align-self: left;
  }
    
    .custom-dip-container {
      background: #fff;
      width: 100%;
      max-width: 80%;
      border-radius: 10px;
      padding: 1.5rem;
      position: relative;
  }

    .provider-right {
        margin-top: 1rem;
        align-items: center;
    }

    .provider-logo {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .provider-detail-container {
        max-width: 90vw;
        padding: 1rem 0.5rem;
        border-radius: 0;

        font-size: 1rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .provider-detail-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 1rem;
    }
    .provider-logo-placeholder {
        margin-bottom: 0 !important;
        margin-right: 1rem !important;
        align-self: flex-start !important;
    }
    .provider-detail-name {
        font-size: 1.1rem !important;
        align-self: center !important;
        margin: 0 !important;
        flex: 1 1 auto;
        text-align: left !important;
    }
    .fee-table th, .fee-table td {
        padding: 0.5rem;
        font-size: 0.95rem;
    }
    .provider-offer-link {
        max-width: 70%;
        padding: 2rem 0;
        font-size: 1.1rem;
        box-sizing: border-box;
        text-align: center;
        align-self: center;
    }
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Provider Detail View */
.provider-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.provider-detail-overlay.active {
    display: flex;
}

.provider-detail-container {
    background-color: var(--white);
    width: 100vw;
    max-width: 60vw;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    overflow-y: auto;
    font-size: 1rem;
    box-sizing: border-box;
}



.provider-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    background: none;
    border: none;
    width: auto;
    padding: 0.5rem;
    margin: 0;
}

.provider-detail-close {
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    transition: none !important;
}
.provider-detail-close:hover, .provider-detail-close:active {
    background: none !important;
    box-shadow: none !important;
}

.provider-detail-header {
    align-items: left;
    margin-bottom: 1rem;
}

.provider-logo-placeholder {
    width: 80px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60rem !important;
    max-height: 40rem !important;
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    justify-content: left;
    align-items: left;
    font-weight: bold;
}

.provider-logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.provider-detail-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.fee-table th {
    text-align: left;
    padding: 0.25rem;
    border-bottom: 2px solid var(--primary-color);
}

.fee-table td {
    padding: 0.25rem;
    border-bottom: 1px solid #eee;
}

/* Ensure consistent column alignment across provider tables */
.provider-detail-content .fee-table {
    table-layout: fixed;
}
.provider-detail-content .fee-table th:first-child,
.provider-detail-content .fee-table td:first-child {
    width: 60%;
    text-align: left;
}
.provider-detail-content .fee-table th:last-child,
.provider-detail-content .fee-table td:last-child {
    width: 40%;
    text-align: right;
}

.provider-offer-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 0;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    padding: 1rem;
}

.provider-offer-link:hover {
    background-color: #0080cc;
}

/* Providers Page */
#providers-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.provider-card-large {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
    overflow: hidden;
}

.provider-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.provider-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    position: relative;
}

.provider-logo-large {
    width: 100px;
    height: 60px;
    background: #fff;
    border: none;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1rem;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
}

.provider-logo-large img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.provider-name-large {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.provider-products {
    padding: 1.5rem;
}

.provider-products h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--primary-color);
}

.products-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.products-list li {
    font-size: 0.92rem;
    padding: 0.1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.products-list li:last-child {
    border-bottom: none;
}

.provider-min-investment {
    margin-top: 0.3rem;
    padding: 1.5rem;
    border-top: 1px solid #f0f0f0;
    color: var(--dark-gray);
    font-size: 0.92rem;
    background-color: transparent;
}

/* About Page */
.about-content {
    background-color: var(--white);
    padding: 2rem;
    text-align: center;
    margin: 0 auto;
    max-width: 1600px;
}
.about-content h2 {
    border-bottom: none;
}
.about-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}


.available-providers-header {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.provider-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.provider-pill {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 161, 255, 0.3);
}


/* Recommended badge */
.result-card-recommended, .recommended-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: 5px 10px;
    border-radius: 0 0 8px 0;
    font-weight: bold;
    z-index: 1;
    background-color: var(--primary-color);
    color: var(--white);
}

/* Position relative for badges */
.result-card, .provider-card-large {
    position: relative;
} 

/* Provider Card Header (copied from working version) */
.provider-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
} 

.contribution-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}

.contribution-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 300px;
    padding: 0 10px;
}

.contribution-group h2 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.contribution-group .large-input {
    margin-bottom: 0;
    align-items: center;
}

.allocation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.allocation-table th, .allocation-table td {
    text-align: center;
    padding: 0.5rem;
}

.allocation-table th {
    font-weight: bold;
}

.allocation-table label {
    font-weight: normal;
} 

.allocation-label {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

.centered-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.available-providers {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
    margin-top: 30rem;
}

.chart-container {
    margin-top: 2rem;
    height: 25vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
} 

@media (min-width: 901px) {
  .container {
    max-width: 80vw;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 0;
  }
  .allocation-total {
    margin-top: -2vh;
  }
  .two-column-layout {
    max-width: 50vw;
    margin: 0 auto 2rem auto;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
  }
  .input-section, .chart-section {
    max-width: 340px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
  }
  .middle-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
  }
  .chart-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
  }
} 

@media (min-width: 901px) {
  .two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto 2rem auto;
    align-items: flex-start;
  }
  .two-column-layout .input-section {
    max-width: 500px;
    margin-left: auto;
    margin-right: 0;
  }
  .two-column-layout .middle-column {
    max-width: 400px;
    margin-right: auto;
    margin-left: 0;
  }
  .result-card-logo {
    width: 80px;
    height: 80px;
    margin-right: 20px;
    object-fit: contain;
    align-self: center;
}
}

/* --- Center the Dostupní poskytovatelé section perfectly --- */
.available-providers-col {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.available-providers {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto !important;
    text-align: center;
    width: 100%;
    max-width: 600px;
} 

@media (max-width: 780px) {
  .container {
    width: 95vw;
    max-width: 95vw;
    padding: 1rem 0.5rem;
  }
  .main-nav {
    padding: 0.5rem 0;
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .nav-links {
    flex-direction: column;
    width: 100%;
    margin-top: 4rem;
  }
  .nav-links li {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  h1, h2, h3 {
    font-size: 1.2rem;
  }
  .header {
    margin-bottom: 1rem;
  }
  .two-column-layout {
    flex-direction: column !important;
    display: flex !important;
    gap: 1rem;
    max-width: 100vw;
    margin: 0 auto 1rem auto;
  }
  .left-column, .right-column {
    width: 100%;
    flex: unset;
  }
  .input-section, .chart-section {
    padding: 1rem 0.5rem;
    max-width: 100vw;
  }
  .large-input, .allocation-input {
    font-size: 1rem;
    padding: 0.7rem;
    border: 2px solid var(--primary-color) !important;
  }
  .large-input {
    width: 100%;
    padding: 1rem;
    border-radius: 30px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    /* Remove spinner buttons */
    appearance: textfield;
    appearance: textfield;
    -moz-appearance: textfield;
}
  button, .provider-offer-link {
    font-size: 1rem;
    padding: 0.7rem 0.5rem;
    width: 100%;
  }
  .result-card, .provider-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .allocation-total {
    text-align: right;
    font-weight: bold;
    margin-top: 1vh;
}

/* iPad mini and tablet tweaks (portrait and landscape) */
@media (min-width: 600px) and (max-width: 900px) {
  /* Layout */
  .container {
    width: 95vw;
    max-width: 95vw;
    padding: 1.5rem 1rem;
  }
  .nav-container {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .nav-links {
    flex-direction: row;
    width: auto;
    margin-top: 0;
    gap: 2vw;
  }
  .two-column-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: flex-start;
    max-width: 900px;
    margin: 0 auto 1.5rem auto;
  }
  .input-section, .chart-section {
    padding: 1.25rem;
    max-width: 420px;
    margin: 0 auto;
  }
  .allocation-total {
    margin-top: 1vh;
    text-align: center;
  }
  .chart-container {
    height: 240px;
  }
  .available-providers {
    margin-top: 2rem;
  }
  .info-btn {
    font-size: 1rem;
  }
}

  .result-card-section, .provider-left, .provider-right {
    flex-direction: column;
    align-items: left;
    text-align: left;
  }
  .result-card-details, .provider-details {
    margin-left: 0;
    font-size: 0.9rem;
  }
  .providers-list, #providers-container {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    margin-top: 1rem;
  }
  .provider-detail-container {
    padding: 0.5rem 0.2rem;
    max-width: 98vw;
    font-size: 0.9rem;
  }
  .fee-table th, .fee-table td {
    font-size: 0.85rem;
    padding: 0.3rem;
  }
  .about-content {
    padding: 1rem;
    margin-top: 1rem;
  }
  .available-providers {
    max-width: 100vw;
    padding: 0 0.5rem;
  }
  .chart-container {
    height: 180px;
    margin-top: 1rem;
  }
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
    font-size: 15px;
  }
} 

@media (max-width: 480px) {
  /* Fix for Příspěvek zaměstnavatele and spočítat button */

  #calculate-btn { width: 100%; }


  .large-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 30px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    /* Remove spinner buttons */
    -moz-appearance: textfield;
}

  .info-btn {
    font-size: 0.9rem;
    max-width: 40%;
  }

  #back-btn {
    width: auto;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Results header buttons: keep on one line and proper sizing */
  .results-header { flex-wrap: wrap; }
  .results-header button { 
    width: auto !important; 
    white-space: nowrap; 
    font-size: 0.9rem; 
    padding: 0.7rem 1rem; 
  }
  #add-custom-dip-btn { width: auto !important; white-space: nowrap; }

  /* Fix for Dostupní poskytovatelé section */
  .available-providers {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden;
  }
  

  /* Fix for provider card in results page */
  .result-card,
  .provider-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 1.2rem;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
  }

  .provider-card-large {
    max-width: 90%;
    width: 90%;
    box-sizing: border-box;
    padding: 1.2rem;
    margin-left: 1rem;
    margin-right: 1rem;
    overflow-x: hidden;
  }

  .provider-detail-container {
    max-width: 90%;
    box-sizing: border-box;
    padding: 1.5rem;
    margin-left: 0;
    align-items: center;
  }

  /* Prevent horizontal scroll on all children */
  .container, .input-section, .chart-section, .providers-list, #providers-container {
    max-width: 98vw;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
   }
    .nav-links li {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .main-info-modal-box {
        background: white;
        padding: 2rem;
        border-radius: 10px;
        max-width: 78% !important;
        position: relative;
        font-size: 1rem;
        text-align: left;
        max-height: 70vh;
      }
} 

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 1;
}
.logo img {
  max-height: 40px;
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 900px) {
  .allocation-input {
    border-width: 1px;
    border-style: solid;
    border-color: var(--primary-color);
  }
  .allocation-total {
    text-align: center;
  }
}
@media (max-width: 600px) {
  .logo {
    height: 30px;
  }
  .logo img {
    max-height: 30px;
  }
} 

#main-info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#main-info-modal .main-info-modal-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  position: relative;
  font-size: 1.1rem;
  text-align: left;
}
#main-info-modal .main-info-modal-close {
  display: none;
} 

/* Main info modal tabs */
.main-info-tab {
  flex: 1 1 180px;
  padding: 0.7rem 1rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  width: auto;
  margin-top: 0;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.main-info-tab.active {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
}
.main-info-tab:not(.active) {
  background-color: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}
.main-info-tab:not(.active):hover {
  background-color: #f5fbff;
}

@media (min-width: 901px) {
  .allocation-table {
    font-size: 1.25rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 1.5rem auto;
  }
  .allocation-table th, .allocation-table td {
    padding: 1rem 1.2rem;
    font-size: 1.15rem;
  }
  .allocation-input {
    font-size: 1.2rem;
    padding: 0.8rem 1.2rem;
    width: 120px;
    max-width: 100%;
  }
} 