@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    height: 90vh;
    margin: 0;
}

/* General Navigation Styles */
.nav-link {
    padding: 0.5rem 0.75rem;
    /* px-3 py-2 */
    border-radius: 0.375rem;
    /* rounded-md */
    background-color: #f3f4f6;
    /* gray-100 - default bg */
    color: #374151;
    /* gray-700 - default text */
    transition: background-color 0.2s, color 0.2s, transform 0.1s ease;
    /* Added transform transition */
}

.nav-link:hover {
    background-color: #cbd5e1;
    /* gray-300 on hover */
    color: #1d4ed8;
    /* blue-700 on hover */
}

.nav-link.active {
    background-color: #6795d1;
    /* blue-ish active bg */
    color: #2563eb;
    /* blue-600 */
    font-weight: 600;
    /* font-semibold */
}

/* Mobile Nav (if ever re-introduced) */
.mobile-nav-link {
    transition: background-color 0.2s;
}

.mobile-nav-link:hover {
    background-color: #f7fafc;
    /* gray-100 */
}


/* Page Content Hiding */
.page-content.hidden {
    display: none;
}


/* Modal Styles (from inward.html) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s ease-in-out;
    /* MODIFIED: Was 0.3s */
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 60rem;
    /* --- ANIMATION MODIFICATION --- */
    transform: scale(0.95) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-in-out;
    opacity: 0;
}


.modal-overlay:not(.hidden) .modal-content {
    /* When the modal is active (overlay is not hidden) */
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Custom styles for the searchable dropdown (Supplier field) */
.custom-select-wrapper {
    position: relative;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.custom-select-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4a5568;
}

.custom-select-option:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.custom-select-option.add-new {
    font-weight: 600;
    color: #4299e1;
    border-top: 1px solid #e2e8f0;
}

.custom-select-option.add-new:hover {
    background-color: #ebf8ff;
}

/* --- Hide Scrollbars --- */
::-webkit-scrollbar {
    display: none;
}

body,
.custom-select-options,
.overflow-x-auto,
.modal-body-scrollable {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


/* --- Horizontal Timeline Styles --- */
.timeline {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
}

.timeline-step {
    position: relative;
    flex: 1;
    text-align: center;
}

.timeline-step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 50%;
    height: 2px;
    width: 100%;
    background-color: #e5e7eb;
    z-index: 0;
}

.timeline-node {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    background-color: white;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.timeline-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
}

/* --- Two Column Vertical Stepper --- */
.workflow-stepper {
    position: relative;
}

.workflow-stepper::before {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    height: calc(100% - 2rem);
    width: 2px;
    background-color: #e5e7eb;
    transform: translateX(-50%);
    /* --- ANIMATION MODIFICATION --- */
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.5s ease-in-out;
}

/* When the stepper is active/visible */
.workflow-stepper.is-active::before {
    transform: scaleY(1);
}


.step-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
}

.step-item:last-child {
    padding-bottom: 0;
}

.step-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
    border: 2px solid #d1d5db;
    color: #6b7280;
    transition: all 0.3s ease;
}

.step-content {
    flex: 1;
    padding-top: 0.25rem;
}

.step-title {
    font-weight: 500;
    color: #6b7280;
}

/* --- Step States --- */
.step-item.completed .step-icon {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.step-item.completed .step-title {
    color: #1f2937;
}

.step-item.completed::before {
    background-color: #2563eb;
}

.step-item.active .step-icon {
    background-color: #dbeafe;
    border-color: #2563eb;
    color: #2563eb;
}

.step-item.active .step-title {
    color: #1d4ed8;
    font-weight: 600;
}

.step-item.pending {
    opacity: 0.6;
}

/* --- Tab Styles --- */
.cutting-tab {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    color: #6b7280;
    transition: all 0.2s ease-in-out;
}

.cutting-tab:hover {
    color: #374151;
    border-bottom: 2px solid #d1d5db;
}

.cutting-tab.active-tab,
.nav-tab.active-tab {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
    font-weight: 600;
}


/* --- Styles for the new QC Workflow --- */
.timeline-node.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    transform: scale(1.1);
}

.timeline-node.active~.timeline-label {
    color: #1d4ed8;
    font-weight: 600;
}

.qc-decision-btn {
    transition: transform 0.1s ease;
    /* Added for press effect */
}

.qc-decision-btn.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px #3b82f6;
}

.qc-rejection-btn.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* --- Fixed Size Modals --- */
#qualityCheckModal .modal-content,
#jobDetailsModal .modal-content {
    width: 896px;
    max-width: 896px;
    height: 618px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#qualityCheckModal .modal-header,
#jobDetailsModal .modal-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

#qualityCheckModal .modal-footer,
#jobDetailsModal .modal-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

#qualityCheckModal .modal-body-scrollable,
#wrappingDetailsModal .modal-body-scrollable,
#jobDetailsModal .modal-body-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}


/* --- Fixed Size for Wrapping Modal --- */
#wrappingDetailsModal .modal-content {
    width: 896px;
    max-width: 896px;
    height: 618px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#wrappingDetailsModal .modal-header,
#wrappingDetailsModal .modal-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

#wrappingDetailsModal .modal-header {
    border-top: 0;
    border-bottom: 1px solid #e5e7eb;
}

#raw-material-section {
    height: 416px;
}

/* --- ENHANCED FORM STYLES --- */

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-icon {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    pointer-events: none;
    /* --- ANIMATION MODIFICATION --- */
    transition: color 0.2s ease-in-out;
}

.input-field-with-icon {
    width: 100%;
    padding-left: 3rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field-with-icon:focus {
    outline: none;
    border-color: #3b82f6;
    /* --- ANIMATION MODIFICATION --- */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

/* Change icon color when the input is focused */
.input-field-with-icon:focus~.input-group-icon {
    color: #3b82f6;
    /* blue-500 */
}


select.input-field-with-icon {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.input-group-addon {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}

.input-group-addon:hover {
    color: #1f2937;
}

.modal-overlay-top {
    z-index: 1050;
}

.accordion-icon.rotate-180 {
    transform: rotate(180deg);
}


/*
==============================================
--- Animation Enhancements ---
==============================================
*/

/* 1. Interactive Button "Press" Effect */
.nav-link:active,
.qc-decision-btn:active {
    transform: translateY(1px) scale(0.98);
}


/* 2. Animated Stepper Icon "Pop" */
@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply the pop-in animation to stepper icons when they become active or completed */
.step-item.completed .step-icon,
.step-item.active .step-icon {
    animation: pop-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}


/* 3. Smooth Accordion Icon Rotation */
/* Add this to a base class for any accordion icon you use */
.accordion-icon {
    transition: transform 0.3s ease-in-out;
}