/* 
 * Main Stylesheet for Dyeing & Printing Mill Management System
 * 
 * This file contains the core styles for the application
 */

/* Global Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Tables */
.table th {
    border-top: 0;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
}

/* Alerts */
.alert {
    border-radius: 0.375rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
}

/* Badges */
.badge {
    border-radius: 0.375rem;
}

/* Specific styles for Chart of Accounts */
.coa-hierarchy-indent {
    margin-left: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Additional styles for better UX */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Sidebar navigation */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #343a40;
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1.25rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    border-left: 3px solid #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Page content */
.page-content {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* Card styles */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Form styles */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 0.375rem;
}

/* Table styles */
.table th {
    border-top: 0;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Alert styles */
.alert {
    border-radius: 0.5rem;
}

/* Badge styles */
.badge {
    font-size: 0.75em;
}

/* Button group styles */
.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        position: relative;
    }
    
    .page-content {
        padding-top: 15px;
    }
}

/* Utility classes */
.text-muted {
    color: #6c757d !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, #007bff 0%, #0062cc 100%);
}

.bg-secondary-gradient {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.bg-success-gradient {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-info-gradient {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.bg-warning-gradient {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
}

.bg-danger-gradient {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Animation for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom form controls */
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #007bff;
    border-color: #007bff;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form validation */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
}

/* Modal styles */
.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Pagination */
.pagination .page-link {
    color: #007bff;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Chart of Accounts specific styles */
.account-name-cell {
    display: flex;
    align-items: center;
    min-height: 24px;
}

.hierarchy-indicator {
    color: #6c757d;
    margin-right: 5px;
    font-size: 12px;
}

.account-name-cell .badge {
    font-size: 0.7em;
    padding: 3px 6px;
}

#coaTable tbody tr {
    transition: background-color 0.2s ease;
}

#coaTable tbody tr:hover {
    background-color: #f8f9fa;
}

.form-select:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
}

.filter-section {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-section .form-label {
    font-weight: 600;
    color: #495057;
}

/* Additional Chart of Accounts styles for production */
.actions-column {
    min-width: 120px;
    text-align: center;
}

.btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.account-transactions-summary {
    margin-bottom: 1.5rem;
}

.account-transactions-summary .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.account-transactions-summary .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.transaction-table th {
    background-color: #f8f9fa;
    border-top: none;
}

.running-balance-positive {
    color: #28a745;
    font-weight: 500;
}

.running-balance-negative {
    color: #dc3545;
    font-weight: 500;
}

.no-transactions-placeholder {
    padding: 3rem;
}

.no-transactions-placeholder i {
    opacity: 0.3;
}
