/* ===========================
   Glass Cutting Calculator CSS
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

.gcc-wrap {
    font-family: 'Jost', sans-serif;
    max-width: 960px;
    margin: 32px auto;
    background: #0d1117;
    color: #e6edf3;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #21262d;
    box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
}

/* HEADER */
.gcc-header {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    border-bottom: 1px solid #21262d;
    padding: 28px 36px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.gcc-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, transparent 79px, rgba(88,166,255,.06) 79px, rgba(88,166,255,.06) 80px, transparent 80px),
        linear-gradient(0deg, transparent 79px, rgba(88,166,255,.06) 79px, rgba(88,166,255,.06) 80px, transparent 80px);
    background-size: 80px 80px;
    pointer-events: none;
}

.gcc-header::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(88,166,255,.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gcc-header-icon {
    width: 52px; height: 52px;
    background: rgba(88,166,255,.12);
    border: 1px solid rgba(88,166,255,.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #58a6ff;
    flex-shrink: 0;
}

.gcc-header-icon svg { width: 28px; height: 28px; }

.gcc-title {
    font-size: 22px;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 4px;
    letter-spacing: -.3px;
}

.gcc-subtitle {
    font-size: 13px;
    color: #7d8590;
    margin: 0;
    font-weight: 400;
}

/* BODY */
.gcc-body {
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CARDS */
.gcc-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 24px;
    position: relative;
}

.gcc-sheet-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0; height: 3px;
    background: linear-gradient(90deg, #58a6ff, #3fb950);
    border-radius: 12px 12px 0 0;
}

.gcc-card-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #7d8590;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gcc-badge {
    background: rgba(88,166,255,.15);
    color: #58a6ff;
    border: 1px solid rgba(88,166,255,.3);
    border-radius: 6px;
    padding: 2px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
}

.gcc-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.gcc-field {
    flex: 1;
    min-width: 140px;
}

.gcc-field-sm { max-width: 160px; }

.gcc-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #7d8590;
    margin-bottom: 8px;
    letter-spacing: .3px;
}

.gcc-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.gcc-input::-webkit-outer-spin-button,
.gcc-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.gcc-input:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}

/* PIECES TABLE */
.gcc-pieces-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #484f58;
    padding: 0 0 10px;
    border-bottom: 1px solid #21262d;
    margin-bottom: 12px;
}

.gcc-pieces-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 40px;
    gap: 10px;
    align-items: center;
}

.gcc-piece-item {
    padding: 6px 0;
}

.gcc-piece-item .gcc-input {
    font-size: 14px;
    padding: 8px 12px;
}

.gcc-btn-remove {
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 7px;
    color: #6e7681;
    cursor: pointer;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    padding: 0;
}

.gcc-btn-remove:hover {
    border-color: #f85149;
    color: #f85149;
    background: rgba(248,81,73,.08);
}

.gcc-btn-add {
    background: transparent;
    border: 1px dashed #30363d;
    border-radius: 8px;
    color: #58a6ff;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    transition: all .2s;
}

.gcc-btn-add:hover {
    border-color: #58a6ff;
    background: rgba(88,166,255,.06);
}

/* CALCULATE BUTTON */
.gcc-btn-calc {
    background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 15px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .2s;
    box-shadow: 0 4px 20px rgba(31,111,235,.3);
    letter-spacing: .3px;
}

.gcc-btn-calc:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(31,111,235,.4);
}

.gcc-btn-calc:active { transform: translateY(0); }

.gcc-btn-calc.gcc-loading {
    opacity: .7;
    cursor: not-allowed;
}

/* ERROR */
.gcc-error {
    background: rgba(248,81,73,.1);
    border: 1px solid rgba(248,81,73,.3);
    border-radius: 8px;
    color: #f85149;
    font-size: 14px;
    padding: 12px 16px;
}

/* STATS */
.gcc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.gcc-stat {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: center;
}

.gcc-stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: #58a6ff;
    line-height: 1;
    margin-bottom: 6px;
}

.gcc-stat-val.green { color: #3fb950; }
.gcc-stat-val.orange { color: #d29922; }

.gcc-stat-lbl {
    font-size: 11px;
    color: #7d8590;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-weight: 500;
}

/* SHEET VISUALIZATION */
.gcc-sheet-block {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.gcc-sheet-title {
    font-size: 13px;
    font-weight: 600;
    color: #7d8590;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gcc-sheet-title span {
    font-family: 'JetBrains Mono', monospace;
    color: #58a6ff;
    font-size: 11px;
    background: rgba(88,166,255,.1);
    border: 1px solid rgba(88,166,255,.2);
    border-radius: 5px;
    padding: 2px 8px;
}

.gcc-canvas-wrap {
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.gcc-canvas {
    border: 1px solid #30363d;
    border-radius: 6px;
    max-width: 100%;
    height: auto;
}

/* OFFCUTS LIST */
.gcc-offcuts {
    margin-top: 16px;
}

.gcc-offcuts-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #484f58;
    margin-bottom: 10px;
}

.gcc-offcuts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gcc-offcut-tag {
    background: rgba(63,185,80,.08);
    border: 1px solid rgba(63,185,80,.2);
    border-radius: 6px;
    color: #3fb950;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 4px 10px;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .gcc-body { padding: 20px; }
    .gcc-header { padding: 20px; }
    .gcc-field-sm { max-width: 100%; }
    .gcc-pieces-row {
        grid-template-columns: 1fr 1fr 40px 36px;
        gap: 6px;
    }
    .gcc-stat-val { font-size: 22px; }
}

/* Sheet fully used indicator */
.gcc-sheet-full {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #3fb950;
    background: rgba(63,185,80,.08);
    border: 1px solid rgba(63,185,80,.2);
    border-radius: 7px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gcc-offcut-tag small {
    opacity: .7;
    font-size: 10px;
    margin-left: 4px;
}
