/* Import navbar and footer styles */
@import url("../styles.css");

/* Root Variables for Consistent Theming */
:root {
    --primary-color: #104788;
    --primary-hover: #082e5d;
    --background-color: #ffffff;
    --text-color: #333333;
    --input-background: #f0f4f8;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-background: #f9f9f9;
    --button-text-color: #ffffff;
}

input {
    font-family: 'Roboto', Arial, sans-serif;
}

/* Kalkulačka Background */
.calculator-background {
    width: 100%;
    background-color: var(--primary-color);
    padding: 60px 0 80px 0; /* Přidán spodní padding pro prostor pro fixní footer */
}

.calculator-container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
    background: var(--background-color); /* Keeps the internal box color */
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    text-align: center;
}

.calculator-box {
    padding: 40px 30px;
    border-radius: 12px;
    max-width: 800px;
    margin: 20px auto;
    transform: translateY(-5px); /* Nastavíme posunutí nahoru natrvalo */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Nastavíme větší stín natrvalo */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator-box h2 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 1em;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper input[type="text"] {
    background: var(--input-background);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1.2em;
    color: var(--primary-color);
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    width: 80%;
    text-align: center;
}

.input-wrapper input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary-color), #67c2ef);
    outline: none;
    transition: background 0.3s;
    margin-bottom: 1em;
}

.input-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    transition: background 0.3s, transform 0.3s;
}

.input-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.2);
}

.input-wrapper input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#pension-duration-value,
#investment-period-value {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 700;
}

.calculate-button {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.calculate-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

#result {
    margin-top: 30px;
    font-size: 1.4em;
    color: var(--text-color);
    text-align: center;
    min-height: 40px;
}

/* Styl pro modal */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    z-index: 1001;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--modal-background);
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 1300px;
    text-align: left;
    position: relative;
    box-shadow: 0 8px 20px var(--shadow-color);
    
    /* Přidání maximální výšky a scrollování */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-left, .modal-right {
    width: 48%;
}

.modal-left h2, .modal-right h2 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-left p, .modal-left #modal-result {
    font-size: 1.1em;
    color: #333;
}

.modal-left #modal-result {
    background-color: #f9f9f9;
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.4em;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    margin-top: 20px;
}

.modal-left #modal-result span {
    display: block;
    font-size: 1.2em;
    color: #333;
}

.modal-left .additional-message {
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--text-color);
    text-align: center;
}

.modal-right form {
    display: flex;
    flex-direction: column;
}

.modal-right .form-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-right .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}

.modal-right .form-group.full-width {
    margin: 10px 0 20px 0;
}

.modal-right .form-group label {
    font-weight: bold;
    font-size: 1em;
}

.modal-right .form-group input,
.modal-right .form-group textarea {
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.1em;
    transition: border-color 0.3s;
}

.modal-right .form-group input:focus,
.modal-right .form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.modal-right .form-group textarea {
    resize: vertical;
    min-height: 120px;
}

button[type="submit"] {
    padding: 16px 32px;
    background-color: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.3em;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

/* Styl pro zavírací tlačítko */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

/* Footer styling */
.site-footer {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    position: fixed; /* Fixní na desktopu */
    bottom: 0;
    left: 0;
    padding: 10px 0;
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .modal-left, .modal-right {
        width: 100%;
    }

    .modal-content {
        flex-direction: column;
    }

    .modal-left #modal-result {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
    }

    .input-group {
        margin: 10px 0;
    }

    .modal-content {
        max-width: 90%;
    }

    .modal-right .form-row {
        flex-direction: column;
    }

    /* Styl pro hamburger menu na mobilních zařízeních */
    .header-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
    }

    .logo {
        order: 1;
        margin-right: 0;
    }

    .hamburger {
        display: block;
        order: 2;
        font-size: 2em;
        background: none;
        border: none;
        cursor: pointer;
    }

    nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background: white;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    nav.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        text-align: left;
        padding: 10px;
        margin: 0;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .nav-links li a {
        display: block;
        padding: 10px;
        width: 100%;
        text-align: left;
    }

    /* Úprava footeru, aby nebyl fixní na mobilních zařízeních */
    .site-footer {
        position: static; /* Statický na mobilech */
        padding: 20px 10px;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-item {
        margin: 10px 0;
    }

    .social-links {
        flex-direction: row;
        justify-content: center;
        margin-top: 10px;
    }

    .social-links a {
        margin: 0 10px;
    }

    .name {
        width: 150px;
    }
}

/* Další vylepšení pro mobilní zařízení */
@media (max-width: 480px) {
    .logo img {
        width: 8em;
    }

    .nav-links {
        font-size: 0.9em;
    }

    .input-group label {
        font-size: 0.9em;
    }

    .input-wrapper input[type="text"] {
        font-size: 1.1em;
        width: 90%;
    }

    .input-wrapper input[type="range"] {
        height: 6px;
        margin-bottom: 10px;
    }

    .slider-container {
        flex-direction: column;
        align-items: flex-start;
    }

    #pension-duration-value,
    #investment-period-value {
        font-size: 1em;
    }

    .calculate-button {
        padding: 12px;
        font-size: 1em;
    }

    .modal-content {
        padding: 15px;
        max-width: 500px; /* Omezit maximální šířku modalu na menších obrazovkách */
    }

    .modal-left, .modal-right {
        width: 100%;
    }

    .modal-right .form-group input,
    .modal-right .form-group textarea {
        width: 100%;
    }

    /* Styl pro footer na malých obrazovkách */
    .social-links a img {
        width: 30px;
        height: 30px;
    }

    .additional-message {
        font-size: 1em;
    }
}
