/* Custom styles for Logistics SaaS - Thai Version */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* Sidebar animations */
.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    padding-left: 1.25rem;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Table styles */
table {
    border-collapse: separate;
    border-spacing: 0;
}

thead tr th:first-child {
    border-top-left-radius: 8px;
}

thead tr th:last-child {
    border-top-right-radius: 8px;
}

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

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form inputs */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button styles */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* Modal animations */
.modal-enter {
    animation: modalEnter 0.3s ease;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dashboard KPI cards */
.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Smaller padding and margins on mobile */
    .mobile-padding {
        padding: 0.5rem;
    }
    
    /* Responsive tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    /* KPI cards on mobile */
    .kpi-value {
        font-size: 1.25rem;
    }
    
    /* Modal on mobile */
    .modal-content {
        margin: 1rem;
        max-height: 90vh;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none;
    }
    
    /* Sticky table headers */
    thead {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }
    
    /* Mobile navigation */
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .nav-link:hover {
        padding-left: 1rem;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Smaller buttons on mobile */
    .btn-mobile {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Compact forms on mobile */
    .form-mobile label {
        font-size: 0.875rem;
    }
    
    .form-mobile input,
    .form-mobile select {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1024px) {
    #sidebar {
        width: 200px;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
}

/* Large screen styles */
@media (min-width: 1024px) {
    .container-max {
        max-width: 1280px;
        margin: 0 auto;
    }
}

/* Touch-friendly buttons */
@media (pointer: coarse) {
    button, .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Print styles */
@media print {
    #sidebar, header, button, .no-print {
        display: none !important;
    }
    
    #content {
        margin: 0;
        padding: 0;
    }
    
    table {
        font-size: 10pt;
    }
}

/* Utility classes for responsive design */
.text-mobile-sm {
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .text-mobile-sm {
        font-size: 1rem;
    }
}

.gap-mobile-2 {
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .gap-mobile-2 {
        gap: 1rem;
    }
}

/* Responsive padding utilities */
.p-mobile-2 {
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .p-mobile-2 {
        padding: 1rem;
    }
}

/* Fix for iOS Safari */
.ios-scroll-fix {
    -webkit-overflow-scrolling: touch;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}