/**
 * Surface Area Calculator Styles
 * Japanese styles for Surface Area Calculator
 *
 * @package Zipper
 */

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

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

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

.sac-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);
}

.sac-compact-section {
    gap: 12px;
}

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

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

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

.sac-shape-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sac-shape-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;
}

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

.sac-shape-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);
}

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

.sac-panel {
    display: flex;
}

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

.sac-field-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.sac-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

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

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

.sac-input,
.sac-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;
}

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

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

.sac-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;
}

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

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

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

.sac-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    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;
}

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

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

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

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

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

.sac-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);
    scroll-margin-top: 96px;
}

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

.sac-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;
}

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

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

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

.sac-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.92);
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.sac-hero-display {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

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

.sac-hero-unit {
    font-size: 18px;
    font-weight: 700;
    color: #7a756d;
    padding-bottom: 6px;
}

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

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

.sac-measure-card {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

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

.sac-measure-card strong {
    font-size: 14px;
    line-height: 1.5;
    color: #2d2a26;
}

.sac-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #4f4942;
}

.sac-formula-box {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px dashed rgba(212, 175, 55, 0.45);
    color: #7a5d18;
    font-size: 13px;
    line-height: 1.6;
}

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

.sac-flow-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

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

.sac-flow-value {
    font-size: 18px;
    font-weight: 800;
    color: #2d2a26;
    line-height: 1.3;
}

.sac-flow-note {
    font-size: 12px;
    line-height: 1.55;
    color: #7a756d;
}

.sac-visual-section {
    gap: 12px;
}

.sac-visual-stage {
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid #eee7d8;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #faf8f2 100%);
}

.sac-shape-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.sac-shape-face {
    fill: rgba(212, 175, 55, 0.16);
    stroke: rgba(212, 175, 55, 0.5);
    stroke-width: 2;
}

.sac-shape-face.is-front {
    fill: rgba(212, 175, 55, 0.12);
}

.sac-shape-face.is-side {
    fill: rgba(212, 175, 55, 0.08);
}

.sac-shape-line {
    fill: none;
    stroke: #8f7a39;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sac-shape-line.is-dashed {
    stroke-dasharray: 6 5;
}

.sac-svg-label {
    fill: #5f5a56;
    font-size: 12px;
    font-weight: 700;
}

.sac-svg-label.is-muted {
    fill: #8a6500;
}

.sac-support-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 12px;
}

.sac-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.sac-summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.sac-summary-table th,
.sac-summary-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe0;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.55;
}

.sac-summary-table th {
    width: 38%;
    color: #7a756d;
    font-weight: 700;
    padding-right: 18px;
}

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

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

.sac-disclaimer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8f6f1;
    border: 1px solid #ebe3d0;
    color: #5f5a56;
    font-size: 13px;
    line-height: 1.6;
}

.sac-disclaimer i {
    color: #d4af37;
    font-size: 16px;
    margin-top: 2px;
}

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

    .sac-input,
    .sac-select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .sac-btn-group {
        flex-direction: column;
    }

    .sac-shape-tab,
    .sac-preset-btn {
        width: 100%;
    }

    .sac-hero-display {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result,
    .sac-section,
    .sac-result-hero,
    .sac-visual-stage {
        max-width: 100%;
        overflow-x: hidden;
    }

    .sac-section,
    .sac-result-hero,
    .sac-flow-card {
        padding: 16px;
    }

    .sac-summary-table th,
    .sac-summary-table td {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sac-shape-tab,
    .sac-input,
    .sac-select,
    .sac-copy-btn,
    .sac-preset-btn,
    .tool-btn {
        transition: none !important;
    }
}
