/* Custom CSS for Datta Able design system */

/* Force remove any underline/border from sidebar brand link */
a.sidebar-brand,
a.sidebar-brand:link,
a.sidebar-brand:visited,
a.sidebar-brand:hover,
a.sidebar-brand:active,
a.sidebar-brand:focus {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

a.sidebar-brand span,
a.sidebar-brand span:hover,
a.sidebar-brand span:focus {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

:root {
    /* Official Company Palette */
    --oxford-blue: #090f29;
    --majorelle-blue: #474fea;
    --neon-blue: #676fff;
    --cadet-gray: #a2a7aa;
    --timberwolf: #d0d3d6;
    --platinum: #e2e4e8;
    --white-smoke: #f2f2f2;
    
    /* Harmonic variations for chapa visualization */
    --harmonic-teal: #0FA3B1;
    --harmonic-teal-light: #85E2FA;
    --harmonic-golden: #EDDEA4;
    --harmonic-golden-dark: #F7A072;
    
    /* Semantic color mapping */
    --primary-color: var(--majorelle-blue);
    --accent-color: var(--neon-blue);
    --sidebar-dark: var(--oxford-blue);
    --sidebar-text: #e2e8f0;
    --background-color: var(--white-smoke);
    --text-primary: var(--oxford-blue);
    --text-secondary: var(--cadet-gray);
    --border-color: var(--platinum);
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-red: #A60303;
    
    /* Datta Able design tokens */
    --sidebar-width: 256px;
    --header-height: 64px;
    --border-radius-base: 8px;
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom animations */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Datta Able Layout Components */

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    transition: width 0.3s ease, transform 0.3s ease;
    background-color: var(--sidebar-dark);
    border-right: 1px solid #334155;
}

.sidebar.sidebar-open {
    transform: translateX(0) !important;
}

/* Sidebar Collapsed State */
.sidebar.sidebar-collapsed {
    width: 80px;
}

.sidebar.sidebar-collapsed .sidebar-brand span {
    display: none;
}

.sidebar.sidebar-collapsed .sidebar-link span {
    display: none;
}

.sidebar.sidebar-collapsed .sidebar-header {
    display: none;
}

.sidebar.sidebar-collapsed .sidebar-link {
    justify-content: center;
}

.sidebar-brand {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-brand:hover,
.sidebar-brand:focus,
.sidebar-brand:active,
.sidebar-brand:visited {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-brand span {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-header span {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.sidebar-link {
    transition: all 0.2s ease;
    border-radius: var(--border-radius-base);
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-link:hover {
    background-color: #334155;
    color: white;
}

.sidebar-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Sidebar brand link styles */
.sidebar-brand {
    color: white !important;
    text-decoration: none !important;
}

.sidebar-brand span {
    color: white !important;
}

/* Header Styling */
.navbar {
    height: var(--header-height);
    box-shadow: var(--shadow-base);
}

/* Dropdown Styling */
.dropdown-menu {
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-base);
    min-width: 12rem;
    z-index: 1000;
}

.dropdown-item {
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--light-purple);
}

/* Card Components */
.card {
    background: white;
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-base);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #f3f4f6;
}

/* Statistics Cards */
.stats-card {
    background: white;
    border-left: 4px solid var(--primary-color);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(71, 79, 234, 0.15);
}

/* Table Styling */
.table-responsive {
    border-radius: var(--border-radius-base);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th:first-child {
    padding-left: 1.5rem;
}

.table th:last-child {
    padding-right: 1.5rem;
}

.table td {
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.table td:first-child {
    padding-left: 1.5rem;
}

.table td:last-child {
    padding-right: 1.5rem;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Specific column widths for better alignment */
.table .w-12 {
    width: 3rem;
    min-width: 3rem;
    max-width: 3rem;
}

.table .w-20 {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
}

/* Center alignment for action columns and checkboxes */
.table th.text-center,
.table td.text-center {
    text-align: center;
}

/* Ensure proper spacing for action buttons */
.table .action-buttons {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

/* Better spacing for expand buttons */
.expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    min-height: 1.5rem;
}

/* Improved checkbox alignment */
.table input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

/* Status badges in tables */
.table .badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius-base);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    width: 100%;
    display: block;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 79, 234, 0.1);
    outline: none;
}

/* Button Styling */
.btn {
    border-radius: var(--border-radius-base);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary:hover {
    background-color: var(--oxford-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(71, 79, 234, 0.4);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Badge Styling */
.badge {
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

/* Custom checkboxes styling (for better cross-browser support) */
input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Focus states for better accessibility */
.focus\:ring-primary-blue:focus {
    --tw-ring-color: rgba(75, 100, 242, 0.5);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Main Content Area Adjustments */
.main {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.main.main-expanded {
    margin-left: 80px;
}

/* Mobile Responsive */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .main.main-expanded {
        margin-left: 0 !important;
    }
}

/* Loading States */
.loading-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.text-accent { color: var(--accent-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }
.border-accent { border-color: var(--accent-color) !important; }

/* Company Color Utilities */
.text-oxford-blue { color: var(--oxford-blue) !important; }
.bg-oxford-blue { background-color: var(--oxford-blue) !important; }
.border-oxford-blue { border-color: var(--oxford-blue) !important; }

.text-majorelle-blue { color: var(--majorelle-blue) !important; }
.bg-majorelle-blue { background-color: var(--majorelle-blue) !important; }
.border-majorelle-blue { border-color: var(--majorelle-blue) !important; }

.text-neon-blue { color: var(--neon-blue) !important; }
.bg-neon-blue { background-color: var(--neon-blue) !important; }
.border-neon-blue { border-color: var(--neon-blue) !important; }

.text-cadet-gray { color: var(--cadet-gray) !important; }
.bg-cadet-gray { background-color: var(--cadet-gray) !important; }
.border-cadet-gray { border-color: var(--cadet-gray) !important; }

/* Item Planning Status Styling */
.item-sent-planning {
    background-color: #f0f9ff !important;
    border-left: 3px solid #3b82f6;
    opacity: 0.8;
}

/* ======================================
   CHAPA VISUALIZATION SYSTEM
   ====================================== */

/* Base Material Colors using Company Palette */
.chapa-material-primary {
    background-color: var(--majorelle-blue);
    color: white;
}

.chapa-material-secondary {
    background-color: var(--neon-blue);
    color: white;
}

.chapa-material-tertiary {
    background-color: var(--harmonic-teal);
    color: white;
}

.chapa-material-quaternary {
    background-color: var(--harmonic-golden);
    color: var(--oxford-blue);
}

/* Harmonic Color Variations for Different Material Types */
.chapa-teal-light {
    background-color: var(--harmonic-teal-light);
    color: var(--oxford-blue);
}

.chapa-teal-medium {
    background-color: var(--harmonic-teal);
    color: white;
}

.chapa-golden-light {
    background-color: var(--harmonic-golden);
    color: var(--oxford-blue);
}

.chapa-golden-dark {
    background-color: var(--harmonic-golden-dark);
    color: white;
}

/* Pattern Textures using CSS */
.chapa-pattern-solid {
    /* Solid fill - default */
}

.chapa-pattern-stripes {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.2) 4px,
        rgba(255,255,255,0.2) 8px
    );
}

.chapa-pattern-dots {
    background-image: radial-gradient(
        circle at 2px 2px,
        rgba(255,255,255,0.3) 1px,
        transparent 1px
    );
    background-size: 8px 8px;
}

.chapa-pattern-crosshatch {
    background-image: 
        repeating-linear-gradient(0deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1) 2px, transparent 2px, transparent 6px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1) 2px, transparent 2px, transparent 6px);
}

.chapa-pattern-gradient {
    background: linear-gradient(135deg, currentColor 0%, rgba(255,255,255,0.3) 100%);
}

/* Priority and Status Indicators */
.chapa-priority-high {
    border: 3px solid var(--error-red);
    box-shadow: 0 0 10px rgba(166, 3, 3, 0.3);
}

.chapa-priority-medium {
    border: 2px solid var(--warning-color);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.chapa-priority-low {
    border: 1px solid var(--cadet-gray);
}

.chapa-attention {
    animation: pulse-attention 2s infinite;
    border-color: var(--neon-blue);
}

@keyframes pulse-attention {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(103, 111, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(103, 111, 255, 0);
    }
}

/* Hover and Interactive States */
.chapa-element {
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
}

.chapa-element:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    z-index: 10;
}

.chapa-element.selected {
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(103, 111, 255, 0.5);
}

/* Sequence Labels */
.chapa-sequence-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--oxford-blue);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    z-index: 5;
}

/* Cutting Pattern Lines */
.cutting-line {
    border-top: 2px dashed var(--oxford-blue);
    opacity: 0.7;
}

.cutting-line-vertical {
    border-left: 2px dashed var(--oxford-blue);
    opacity: 0.7;
}

/* Waste Areas */
.chapa-waste {
    background: repeating-linear-gradient(
        45deg,
        var(--cadet-gray),
        var(--cadet-gray) 3px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.6;
}

