/* Apple-style Monochrome Theme for Blaze In */

:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #666666;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --white: #ffffff;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--light-gray);
    color: var(--primary-color);
    line-height: 1.6;
    padding-top: 76px; /* Account for fixed navbar */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--dark-gray) !important;
}

/* Navigation */
.navbar-dark {
    background-color: var(--primary-color) !important;
    backdrop-filter: blur(20px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    margin: 0 4px;
    transition: var(--transition);
}

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

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background-color: var(--white);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--medium-gray);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-secondary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-light {
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
    color: var(--primary-color);
}

.btn-light:hover {
    background-color: var(--medium-gray);
    color: var(--primary-color);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--medium-gray);
    padding: 0.75rem;
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th {
    background-color: var(--light-gray);
    font-weight: 600;
    border-bottom: 2px solid var(--medium-gray);
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--medium-gray);
}

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

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge.status-quote {
    background-color: var(--accent-color);
    color: var(--white);
}

.badge.status-deposit {
    background-color: #ffc107;
    color: var(--primary-color);
}

.badge.status-paid {
    background-color: #28a745;
    color: var(--white);
}

.badge.status-completed {
    background-color: #007bff;
    color: var(--white);
}

.badge.status-cancelled {
    background-color: #dc3545;
    color: var(--white);
}

/* Quick Actions (Fixed Button) */
.quick-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
}

.quick-actions .btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Responsive Grid */
.transaction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Search and Filters */
.filter-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-input {
    position: relative;
}

.search-input .form-control {
    padding-left: 2.5rem;
}

.search-input .fas {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

/* Line Items */
.line-item {
    padding: 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    background-color: var(--white);
}

.line-item:last-child {
    margin-bottom: 0;
}

.line-item-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Payment History */
.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--medium-gray);
}

.payment-item:last-child {
    border-bottom: none;
}

/* Expense Image Preview */
.expense-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.expense-image:hover {
    transform: scale(1.05);
}

/* Modal Enhancements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--medium-gray);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    border-top: 1px solid var(--medium-gray);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Print Styles */
@media print {
    .navbar,
    .quick-actions,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--medium-gray);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .transaction-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .quick-actions .btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
    
    /* Stack form controls on mobile */
    .row.g-2 > .col {
        margin-bottom: 0.5rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --primary-color: #ffffff;
        --secondary-color: #cccccc;
        --accent-color: #999999;
        --light-gray: #1a1a1a;
        --medium-gray: #333333;
        --dark-gray: #666666;
        --white: #2a2a2a;
    }
    
    body {
        background-color: var(--light-gray);
        color: var(--primary-color);
    }
    */
}

/* Utility Classes */
.rounded-lg {
    border-radius: var(--border-radius) !important;
}

.rounded-sm {
    border-radius: var(--border-radius-sm) !important;
}

.shadow-custom {
    box-shadow: var(--shadow) !important;
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg) !important;
}

.transition-custom {
    transition: var(--transition) !important;
}

/* Loading States */
.btn-loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn-loading::after {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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