/* LinearCutCalculator.css - Calculator-specific styles only */
/* DO NOT redefine global classes: .glass-card, .form-input, .btn-custom, .btn-sponsor, etc. */

/* ===== Input Layout ===== */
.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-row .input-group-custom {
    flex: 1;
}

.input-group-custom {
    margin-bottom: 15px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-label i {
    color: #667eea;
    width: 18px;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
    text-align: right;
}

/* ===== Tooltip ===== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    cursor: help;
    position: relative;
    font-weight: bold;
}

.tooltip-icon .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.2s ease;
    max-width: 250px;
    white-space: normal;
    text-align: center;
}

.tooltip-icon .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===== Cut Requirements List ===== */
.cut-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.cut-item-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.cut-item-row .item-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.cut-item-row .item-inputs {
    display: flex;
    gap: 10px;
    flex: 1;
}

.cut-item-row .item-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cut-item-row .item-input-label {
    font-size: 0.7rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cut-item-row .item-input {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

.cut-item-row .item-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.cut-item-row .btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #fed7d7;
    color: #e53e3e;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cut-item-row .btn-remove:hover {
    background: #e53e3e;
    color: white;
}

.btn-add-item {
    width: 100%;
    padding: 12px;
    border: 2px dashed #48bb78;
    background: transparent;
    color: #48bb78;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-add-item:hover {
    background: #48bb78;
    color: white;
}

.no-items-message {
    text-align: center;
    padding: 30px;
    color: #a0aec0;
    font-style: italic;
}

/* ===== Calculation Mode ===== */
.mode-options {
    display: flex;
    gap: 15px;
}

.mode-option {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-option:hover {
    border-color: #667eea;
}

.mode-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.mode-option input {
    display: none;
}

.mode-option .mode-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.mode-option .mode-desc {
    font-size: 0.8rem;
    color: #718096;
}

/* ===== Results Card ===== */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-card .card-title {
    color: white;
}

.result-main {
    text-align: center;
    padding: 20px 0;
}

.result-main .result-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.result-main .result-value {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    font-family: 'Poppins', sans-serif;
}

.result-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 15px 0;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.result-item .result-item-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 5px;
}

.result-item .result-item-value {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.result-item .result-item-unit {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-left: 3px;
}

/* Utilization color classes */
.utilization-high {
    color: #48bb78 !important;
}

.utilization-medium {
    color: #ecc94b !important;
}

.utilization-low {
    color: #fc8181 !important;
}

/* ===== Cut Diagram ===== */
.cut-diagram-container {
    overflow-x: auto;
    padding: 10px 0;
}

.cut-diagram {
    min-width: 100%;
}

.cut-bar {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cut-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.cut-bar-header .stock-label {
    font-weight: 600;
    color: #2d3748;
}

.cut-bar-header .stock-info {
    color: #718096;
}

.cut-piece {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cut-piece:hover {
    filter: brightness(1.1);
}

.cut-piece .piece-length {
    z-index: 1;
}

/* Cut piece colors */
.cut-piece-0 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.cut-piece-1 { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.cut-piece-2 { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.cut-piece-3 { background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%); }
.cut-piece-4 { background: linear-gradient(135deg, #38b2ac 0%, #319795 100%); }
.cut-piece-5 { background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%); }
.cut-piece-6 { background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%); }
.cut-piece-7 { background: linear-gradient(135deg, #fc8181 0%, #f56565 100%); }

.cut-waste {
    background: repeating-linear-gradient(
        45deg,
        #e2e8f0,
        #e2e8f0 5px,
        #cbd5e0 5px,
        #cbd5e0 10px
    );
    color: #718096;
    font-size: 0.7rem;
}

/* Legend */
.cut-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #4a5568;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.used {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.legend-color.waste {
    background: repeating-linear-gradient(
        45deg,
        #e2e8f0,
        #e2e8f0 3px,
        #cbd5e0 3px,
        #cbd5e0 6px
    );
}

/* ===== Export Buttons ===== */
.export-buttons {
    display: flex;
    gap: 10px;
}

.export-buttons .btn-export {
    flex: 1;
    padding: 12px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.export-buttons .btn-export:hover {
    background: #667eea;
    color: white;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .mode-options {
        flex-direction: column;
    }

    .cut-item-row {
        flex-wrap: wrap;
    }

    .cut-item-row .item-inputs {
        flex: 1 1 100%;
        order: 1;
        margin-top: 10px;
    }

    .cut-item-row .item-number {
        order: 0;
    }

    .cut-item-row .btn-remove {
        order: 0;
        margin-left: auto;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        flex-direction: column;
    }

    .cut-bar {
        height: 40px;
    }

    .cut-piece {
        font-size: 0.65rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .glass-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .cut-diagram-container {
        overflow: visible;
    }

    .btn-add-item,
    .btn-remove,
    .export-buttons {
        display: none !important;
    }
}
