/* StaircaseCalculator.css
 * Calculator-specific styles only
 * DO NOT redefine: .glass-card, .form-input, .btn-custom, .btn-sponsor, .page-header, etc.
 * Reference: GLOBAL_CSS_CLASSES.md
 */

/* ============================================
   Warning Box (Safety Disclaimer)
   ============================================ */
.warning-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 5px solid #ff9800;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.15);
}

.warning-box h3 {
    color: #e65100;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-box h3 i {
    font-size: 1.4rem;
}

.warning-box ul {
    margin: 0;
    padding-left: 20px;
    color: #424242;
}

.warning-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.warning-box li:last-child {
    margin-bottom: 0;
}

/* ============================================
   Result Card (Main Result Display)
   ============================================ */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.result-card .result-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 500;
}

.result-card .result-value {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.1;
    margin-bottom: 5px;
}

.result-card .result-unit {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 20px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-item-label {
    font-size: 0.85rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item-value {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* ============================================
   Headroom Status (Critical Feature)
   ============================================ */
.headroom-status {
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
}

.headroom-status.safe {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.headroom-status.warning {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.headroom-status.danger {
    background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
    animation: pulse-danger 1.5s ease-in-out infinite;
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.headroom-status .status-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.headroom-status .status-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.headroom-status .status-text {
    font-size: 1rem;
    margin-top: 8px;
    opacity: 0.95;
}

/* ============================================
   Stair Diagram (Canvas Container)
   ============================================ */
.stair-diagram-container {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
}

.stair-diagram-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stair-diagram-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
}

.stair-diagram-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#stairDiagram {
    width: 100%;
    height: 300px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
}

/* ============================================
   Compliance Status Badges
   ============================================ */
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.compliance-item {
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
}

.compliance-item.pass {
    background: rgba(72, 187, 120, 0.15);
    color: #276749;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.compliance-item.fail {
    background: rgba(229, 62, 62, 0.15);
    color: #c53030;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

.compliance-item .item-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.compliance-item .item-status {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============================================
   Input Group Custom Styling
   ============================================ */
.input-group-custom {
    margin-bottom: 20px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
    font-size: 0.95rem;
}

.input-label i {
    color: #667eea;
    width: 20px;
    text-align: center;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
}

/* ============================================
   Tooltip
   ============================================ */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 0.75rem;
    color: #4a5568;
    cursor: help;
    position: relative;
    margin-left: 5px;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.2s ease;
    max-width: 250px;
    white-space: normal;
    text-align: left;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

/* ============================================
   Specification Summary Table
   ============================================ */
.spec-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.spec-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.spec-item .spec-label {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 5px;
}

.spec-item .spec-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

.spec-item .spec-unit {
    font-size: 0.85rem;
    color: #a0aec0;
}

/* ============================================
   Code Reference Section
   ============================================ */
.code-ref-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.code-ref-item {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.code-ref-item h4 {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 12px;
    font-weight: 600;
}

.code-ref-item ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
    color: #4a5568;
}

.code-ref-item li {
    margin-bottom: 6px;
}

/* ============================================
   Ergonomic Rating Display
   ============================================ */
.ergonomic-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
}

.ergonomic-rating.comfortable {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.15) 100%);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.ergonomic-rating.steep {
    background: linear-gradient(135deg, rgba(246, 173, 85, 0.1) 0%, rgba(237, 137, 54, 0.15) 100%);
    border: 1px solid rgba(246, 173, 85, 0.3);
}

.ergonomic-rating.dangerous {
    background: linear-gradient(135deg, rgba(252, 129, 129, 0.1) 0%, rgba(229, 62, 62, 0.15) 100%);
    border: 1px solid rgba(252, 129, 129, 0.3);
}

.ergonomic-rating .rating-icon {
    font-size: 2rem;
}

.ergonomic-rating .rating-content {
    flex: 1;
}

.ergonomic-rating .rating-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.ergonomic-rating .rating-desc {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================
   Headroom Check Points Display
   ============================================ */
.headroom-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.headroom-point {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.headroom-point .point-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.headroom-point .point-value {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.headroom-point.critical {
    background: rgba(229, 62, 62, 0.2);
    border: 1px solid rgba(229, 62, 62, 0.4);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991px) {
    .result-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .compliance-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .spec-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .code-ref-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .result-card .result-value {
        font-size: 2.5rem;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .compliance-grid {
        grid-template-columns: 1fr;
    }

    .spec-summary {
        grid-template-columns: 1fr;
    }

    .headroom-status .status-value {
        font-size: 1.5rem;
    }

    #stairDiagram {
        height: 250px;
    }

    .stair-diagram-controls {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   Fullscreen Button
   ============================================ */
.btn-fullscreen {
    background: transparent;
    border: none;
    color: #667eea;
    font-size: 1.1rem;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-fullscreen:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
}

.diagram-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.diagram-card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   Fullscreen Modal
   ============================================ */
.diagram-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.diagram-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.diagram-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.diagram-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.diagram-modal-body {
    padding: 25px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
}

.diagram-modal-body .stair-diagram-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#stairDiagramModal {
    width: 100%;
    min-height: 400px;
    max-height: 70vh;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .warning-box {
        background: #fff3e0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .result-card {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .headroom-status {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
