@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMu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) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.cnc-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    color: white;
    padding: 1.5rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

.main-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.three-viewer {
    width: 100%;
    height: 400px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #475569;
    background: #1a1a2e;
}

.axis-legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.axis-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.axis-line {
    width: 2rem;
    height: 0.25rem;
}

.axis-x {
    background: #ef4444;
}

.axis-y {
    background: #22c55e;
}

.axis-z {
    background: #3b82f6;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-indicator {
    padding: 1rem;
}

.steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
}

    .step.active {
        color: #60a5fa;
    }

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #475569;
}

.step.active .step-number {
    background: #3b82f6;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .input-wrapper label {
        font-size: 0.875rem;
        font-weight: 500;
        color: #cbd5e1;
    }

.input-field {
    width: 100%;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 1rem;
}

    .input-field:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-back {
    padding: 0.3rem 0.3rem;
    border-radius: 0.2rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    background: none;
    color: white;
}
    .btn-back:hover {
        background: linear-gradient(to right, #2563eb, #7c3aed);
        box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    }

.btn-primary {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    margin-top: 1rem;
}

    .btn-primary:hover {
        background: linear-gradient(to right, #2563eb, #7c3aed);
        box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    }

.btn-success {
    background: linear-gradient(to right, #22c55e, #10b981);
    margin-top: 1rem;
}

    .btn-success:hover {
        background: linear-gradient(to right, #16a34a, #059669);
        box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
    }

.btn-generate {
    background: linear-gradient(to right, #a855f7, #ec4899);
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    margin-top: 1rem;
    color: white;
}

    .btn-generate:hover {
        background: linear-gradient(to right, #9333ea, #db2777);
        box-shadow: 0 10px 25px rgba(168, 85, 247, 0.3);
    }

.lines-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
}

.line-item {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.line-info {
    flex: 1;
}

.line-name {
    font-weight: 500;
}

.line-details {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 1rem;
}

    .btn-delete:hover {
        background: rgba(239, 68, 68, 0.3);
    }

.btn-add {
    background: #15825e;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 1rem;
}

    .btn-add:hover {
        background: #1b946c;
    }

.btn-edit {
    background: #adadad;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 1rem;
}

    .btn-edit:hover {
        background: #bababa;
    }

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid #ccc;
    vertical-align: middle;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.22), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

    /* Visible state */
    .modal-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hidden state */
    .modal-backdrop.hidden {
        opacity: 0;
        pointer-events: none;
    }

.modal-card {
    width: min(800px, 95vw);
    max-height: 80vh;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85);
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    animation: modal-pop 0.18s ease-out;
}

/* Header / footer */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .modal-header h2 {
        font-size: 1.25rem;
        font-weight: 600;
        background: linear-gradient(to right, #60a5fa, #a855f7);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        margin: 0;
    }

.modal-close {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 0.15s, transform 0.1s;
}

    .modal-close:hover {
        background: rgba(148, 163, 184, 0.15);
        transform: scale(1.05);
    }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    margin-bottom: 1rem;
}

/* grid uses same style as main form but adapted for modal width */
.modal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(51, 65, 85, 0.8);
}
    .modal-footer span {
        display: flex;
        gap: 10px; /* ensures buttons sit next to each other */
        white-space: nowrap;
    }

/* Secondary button using your existing style base */

.btn-secondary {
    background: rgba(30, 64, 175, 0.3);
    color: #e5e7eb;
    margin-top: 1rem;
}

    .btn-secondary:hover {
        background: rgba(30, 64, 175, 0.5);
        box-shadow: 0 8px 20px rgba(30, 64, 175, 0.45);
    }

/* Small pop animation */

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

    .modal-separator::before,
    .modal-separator::after {
        content: "";
        flex: 1;
        height: 1px;
        background: linear-gradient( to right, transparent, rgba(148, 163, 184, 0.8), transparent );
    }

.glas-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    backdrop-filter: blur(6px);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 0, 0, 0.4);
    outline: none;
    transition: background 0.3s ease;
    margin: 4px;
}

    .glas-slider:hover {
        background: rgba(255, 255, 255, 0.15);
    }

/* Toast notification styles */
.mytoast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.mytoast {
    min-width: 300px;
    max-width: 500px;
    padding: 14px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex; !important;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.4s ease-out, fadeOut 0.6s ease-out 3.6s forwards;
    pointer-events: all;
}

.mytoast-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.mytoast .close-btn {
    margin-left: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}