/**
 * Right Triangle Calculator Styles
 * 직각삼각형 계산기 전용 스타일
 *
 * @package Zipper
 */

.rtg-hidden,
.rtg-waiting[hidden],
.rtg-panel[hidden] {
    display: none !important;
}

.rtg-intro {
    display: grid;
    gap: 10px;
}

.rtg-lead {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.7;
    color: #5f5a56;
}

.rtg-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rtg-compact-section {
    gap: 10px;
}

.rtg-preset-section,
.rtg-tip-section {
    background: #fffdf9;
}

.rtg-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.rtg-section-title i {
    color: #d4af37;
}

.rtg-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rtg-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rtg-mode-tab:hover,
.rtg-mode-tab:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
}

.rtg-mode-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.18);
}

.rtg-mode-help,
.rtg-field-hint,
.rtg-visual-caption {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #7a756d;
}

.rtg-panel {
    display: flex;
}

.rtg-panel.rtg-hidden {
    display: none !important;
}

.rtg-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.rtg-field-grid-compact {
    grid-template-columns: minmax(0, 220px);
}

.rtg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.rtg-field-full {
    grid-column: 1 / -1;
}

.rtg-label {
    font-size: 13px;
    font-weight: 700;
    color: #5f5a56;
}

.rtg-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.rtg-input-wrap-select {
    grid-template-columns: minmax(0, 1fr);
}

.rtg-input,
.rtg-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #fff;
    color: #2d2a26;
    font-size: 15px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rtg-input:hover,
.rtg-select:hover {
    border-color: #d4c67a;
}

.rtg-input:focus,
.rtg-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.rtg-input-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.rtg-btn-group {
    display: flex;
    gap: 8px;
}

.rtg-btn-group .tool-btn {
    flex: 1 1 0;
}

.rtg-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rtg-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rtg-preset-btn:hover,
.rtg-preset-btn:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.rtg-tip-list,
.rtg-step-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.65;
}

.rtg-waiting {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid #eadfb8;
    border-radius: 12px;
    background: #fffaf0;
    color: #7a5d18;
}

.rtg-waiting i {
    font-size: 18px;
    color: #d4af37;
    margin-top: 2px;
}

.rtg-waiting p {
    margin: 0;
    line-height: 1.6;
}

.rtg-result-hero {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid #eadfb8;
    border-radius: 18px;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 12px 28px rgba(212, 175, 55, 0.14);
}

.rtg-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rtg-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.rtg-status-badge.is-neutral {
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
}

.rtg-status-badge.is-valid {
    background: rgba(70, 180, 80, 0.12);
    color: #267237;
}

.rtg-status-badge.is-warning {
    background: rgba(255, 185, 0, 0.16);
    color: #8a6500;
}

.rtg-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rtg-copy-btn:hover,
.rtg-copy-btn:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.rtg-hero-title {
    font-size: 13px;
    font-weight: 700;
    color: #8a6500;
}

.rtg-hero-value {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.05;
    color: #2d2a26;
}

.rtg-hero-label {
    font-size: 14px;
    font-weight: 700;
    color: #6f675d;
}

.rtg-hero-measures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.rtg-measure-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.rtg-measure-name {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
}

.rtg-measure-card strong {
    font-size: 18px;
    font-weight: 800;
    color: #2d2a26;
}

.rtg-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #5f5a56;
}

.rtg-formula-box {
    padding: 12px 14px;
    border: 1px dashed rgba(212, 175, 55, 0.36);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.rtg-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.rtg-kpi-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #ebe7de;
    border-radius: 14px;
    background: #fff;
}

.rtg-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
}

.rtg-kpi-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: #2d2a26;
}

.rtg-visual-section,
.rtg-step-section {
    gap: 12px;
}

.rtg-visual-wrap,
.rtg-table-wrap {
    min-width: 0;
}

.rtg-triangle-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 220px;
    border: 1px solid #eee7d2;
    border-radius: 16px;
    background: linear-gradient(180deg, #fffef9 0%, #faf6eb 100%);
}

.rtg-triangle-shape {
    fill: rgba(212, 175, 55, 0.18);
    stroke: #c28f0e;
    stroke-width: 2.5;
}

.rtg-right-angle-mark {
    fill: none;
    stroke: #8a6500;
    stroke-width: 2;
}

.rtg-triangle-label,
.rtg-angle-label {
    font-size: 12px;
    font-weight: 700;
    fill: #5f5a56;
}

.rtg-angle-label {
    fill: #8a6500;
}

.rtg-support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.rtg-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.rtg-summary-table th,
.rtg-summary-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0ece4;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
}

.rtg-summary-table th {
    width: 42%;
    color: #7a756d;
    font-weight: 700;
}

.rtg-summary-table td {
    color: #2d2a26;
    font-weight: 600;
}

.rtg-summary-table tr:last-child th,
.rtg-summary-table tr:last-child td {
    border-bottom: 0;
}

.rtg-ratio-list {
    display: grid;
    gap: 10px;
}

.rtg-ratio-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #eee7d2;
    border-radius: 12px;
    background: #fffdf8;
}

.rtg-ratio-item-full {
    align-items: flex-start;
    flex-direction: column;
}

.rtg-ratio-name {
    font-size: 13px;
    font-weight: 700;
    color: #6f675d;
}

.rtg-ratio-item strong {
    font-size: 16px;
    font-weight: 800;
    color: #2d2a26;
    text-align: right;
}

.rtg-ratio-item-full strong {
    text-align: left;
}

.rtg-step-list {
    padding-left: 18px;
}

@media (max-width: 900px) {
    #rtgCalculator .rtg-input,
    #rtgCalculator .rtg-select,
    #rtgCalculator .tool-btn {
        max-width: 100%;
        box-sizing: border-box;
    }

    .rtg-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .rtg-field-grid,
    .rtg-support-grid,
    .rtg-hero-measures {
        grid-template-columns: 1fr;
    }

    .rtg-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .rtg-mode-tab {
        flex: 1 1 calc(50% - 4px);
    }
}

@media (max-width: 540px) {
    .rtg-mode-tabs,
    .rtg-btn-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .rtg-mode-tab,
    .rtg-preset-btn {
        width: 100%;
    }

    .rtg-preset-list {
        display: grid;
        gap: 8px;
    }

    .rtg-kpi-grid {
        grid-template-columns: 1fr;
    }

    .rtg-hero-value {
        font-size: 34px;
    }

    .rtg-ratio-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .rtg-ratio-item strong {
        text-align: left;
    }
}
