/**
 * Стили калькулятора ГКЛ
 * Glassmorphism дизайн
 */

/* ===== RESET & BASE ===== */
.gk-calculator {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #ffffff;
    background-color: #1E1E2F;
    padding: 30px;
    border-radius: 20px;
    box-sizing: border-box;
    margin: 20px 0;
}

.gk-calculator *,
.gk-calculator *::before,
.gk-calculator *::after {
    box-sizing: border-box;
}

.gk-calculator input,
.gk-calculator textarea,
.gk-calculator button {
    font-family: inherit;
    font-size: inherit;
}

/* ===== CONTAINER ===== */
.gk-calculator__container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== LEFT COLUMN ===== */
.gk-calculator__left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== RIGHT COLUMN ===== */
.gk-calculator__right {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== ROOM BLOCK ===== */
.gk-room {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
}

.gk-room__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.gk-room__name {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.gk-room__name:focus {
    border-color: #4A90E2;
}

.gk-room__name::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.gk-room__remove {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    color: #ff6b6b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.gk-room__remove:hover {
    background: rgba(255, 100, 100, 0.3);
}

.gk-room__remove svg {
    width: 16px;
    height: 16px;
}

/* ===== BLOCK ===== */
.gk-block {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
}

.gk-block__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #ffffff;
}

/* ===== FIELD GROUP ===== */
.gk-field-group {
    margin-bottom: 16px;
}

.gk-field-group:last-child {
    margin-bottom: 0;
}

.gk-field-group__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

/* ===== INPUTS ===== */
.gk-inputs-row {
    display: flex;
    gap: 15px;
}

.gk-input-with-icon {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.gk-input-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.gk-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px 12px 44px;
    padding-right: 40px;
    color: #ffffff;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.gk-input:focus {
    border-color: #4A90E2;
    background: rgba(255, 255, 255, 0.1);
}

.gk-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gk-input-unit {
    position: absolute;
    right: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    pointer-events: none;
}

/* ===== CARDS GRID ===== */
.gk-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gk-cards-grid--4col {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== CARD TYPE ===== */
.gk-card-type {
    cursor: pointer;
}

.gk-card-type__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gk-card-type__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.2s;
}

.gk-card-type__content:hover {
    background: rgba(255, 255, 255, 0.08);
}

.gk-card-type__input:checked + .gk-card-type__content,
.gk-card-type--active .gk-card-type__content {
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.15);
}

.gk-card-type__icon {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.7);
}

.gk-card-type__input:checked + .gk-card-type__content .gk-card-type__icon,
.gk-card-type--active .gk-card-type__content .gk-card-type__icon {
    color: #ffffff;
}

.gk-card-type__text {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.2;
}

.gk-card-type__input:checked + .gk-card-type__content .gk-card-type__text,
.gk-card-type--active .gk-card-type__content .gk-card-type__text {
    color: #ffffff;
}

/* ===== RADIO GROUP ===== */
.gk-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gk-radio-group--vertical {
    flex-direction: column;
}

.gk-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.gk-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gk-radio__text {
    position: relative;
    padding-left: 28px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.gk-radio__text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s;
}

.gk-radio__text::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 8px;
    height: 8px;
    background: #4A90E2;
    border-radius: 50%;
    transition: transform 0.2s;
}

.gk-radio input[type="radio"]:checked + .gk-radio__text::before {
    border-color: #4A90E2;
}

.gk-radio input[type="radio"]:checked + .gk-radio__text::after {
    transform: translateY(-50%) scale(1);
}

.gk-radio--with-tooltip {
    flex-wrap: wrap;
    align-items: center;
}

/* ===== CHECKBOX ===== */
.gk-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gk-checkbox-group--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gk-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.gk-checkbox__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gk-checkbox__box {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.gk-checkbox__input:checked + .gk-checkbox__box {
    background: #4A90E2;
    border-color: #4A90E2;
}

.gk-checkbox__input:checked + .gk-checkbox__box::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 2px auto;
}

.gk-checkbox__text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.gk-checkbox--inline {
    margin-left: auto;
}

/* ===== TAPE PERIMETER ===== */
.gk-tape-perimeter {
    margin-left: 30px;
    margin-top: 8px;
    transition: all 0.3s;
}

.gk-tape-perimeter--hidden {
    display: none;
}

.gk-tape-perimeter .gk-input {
    padding-left: 16px;
}

/* ===== TOOLTIP ===== */
.gk-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: help;
    position: relative;
}

.gk-tooltip svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.4);
}

.gk-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2D2D44;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.gk-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ===== ADD ROOM BUTTON ===== */
.gk-add-room {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(74, 144, 226, 0.2);
    border: 2px dashed #4A90E2;
    border-radius: 12px;
    padding: 16px;
    color: #4A90E2;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.gk-add-room:hover {
    background: rgba(74, 144, 226, 0.3);
}

.gk-add-room svg {
    width: 20px;
    height: 20px;
}

/* ===== TRIP BLOCK ===== */
.gk-block--trip {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15) 0%, rgba(74, 144, 226, 0.15) 100%);
}

/* ===== VISUAL ===== */
.gk-visual {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gk-visual__svg {
    width: 100%;
    max-width: 380px;
}

.gk-visual__svg svg {
    width: 100%;
    height: auto;
}

/* ===== RESULT ===== */
.gk-result {
    background: linear-gradient(180deg, #1E1E2F 0%, #2D2D44 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
}

.gk-result__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #ffffff;
}

.gk-result__items {
    margin-bottom: 20px;
}

.gk-result__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gk-result__item:last-child {
    border-bottom: none;
}

.gk-result__label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.gk-result__value {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.gk-result__item--trip {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gk-result__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.gk-result__total-label {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.gk-result__total-value {
    font-size: 24px;
    font-weight: 700;
    color: #4A90E2;
}

.gk-result__btn {
    width: 100%;
    background: #4A90E2;
    border: none;
    border-radius: 10px;
    padding: 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 12px;
}

.gk-result__btn:hover {
    background: #357ABD;
}

.gk-result__btn:active {
    transform: scale(0.98);
}

/* ===== MODAL ===== */
.gk-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.gk-modal--active {
    opacity: 1;
    visibility: visible;
}

.gk-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gk-modal__content {
    position: relative;
    background: #1E1E2F;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.gk-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.gk-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gk-modal__close svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.gk-modal__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: #ffffff;
}

.gk-modal__field {
    margin-bottom: 16px;
}

.gk-modal__field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.gk-modal__field input,
.gk-modal__field textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}

.gk-modal__field input:focus,
.gk-modal__field textarea:focus {
    border-color: #4A90E2;
}

.gk-modal__field textarea {
    min-height: 80px;
    resize: vertical;
}

.gk-modal__submit {
    width: 100%;
    background: #4A90E2;
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.gk-modal__submit:hover {
    background: #357ABD;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .gk-calculator__container {
        flex-direction: column;
    }
    
    .gk-calculator__right {
        width: 100%;
        order: -1;
    }
    
    .gk-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    .gk-calculator {
        padding: 20px;
    }
    
    .gk-cards-grid,
    .gk-cards-grid--4col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gk-checkbox-group--grid {
        grid-template-columns: 1fr;
    }
    
    .gk-inputs-row {
        flex-direction: column;
    }
    
    .gk-radio-group {
        flex-direction: column;
    }
    
    .gk-room__header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gk-result__total-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gk-calculator {
        padding: 15px;
        border-radius: 12px;
    }
    
    .gk-room {
        padding: 16px;
    }
    
    .gk-block {
        padding: 16px;
    }
    
    .gk-cards-grid--4col {
        grid-template-columns: 1fr 1fr;
    }
    
    .gk-card-type__content {
        padding: 10px 6px;
    }
    
    .gk-card-type__icon {
        width: 32px;
        height: 32px;
    }
}
