/* Custom Invoicing System Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
}

.sidebar {
    background: linear-gradient(180deg, #343a40 0%, #495057 100%);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: calc(100vh - 56px);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin: 2px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

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

.main-content {
    background: white;
    min-height: calc(100vh - 56px);
    border-radius: 10px 0 0 0;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
}

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0,0,0,0.02);
}

.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

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

.invoice-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.invoice-item:hover {
    border-color: var(--primary-color);
    background: rgba(13,110,253,0.05);
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.dashboard-card .card-body {
    position: relative;
    z-index: 1;
}

/* Statistics Cards */
.stat-card {
    text-align: center;
    padding: 25px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-top: 0;
    }

    .main-content {
        margin-left: 0 !important;
        border-radius: 0;
    }

    .table-responsive {
        border-radius: 8px;
    }
}

/* Loading Spinner */
.spinner-custom {
    width: 40px;
    height: 40px;
    background: conic-gradient(transparent, var(--primary-color));
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.spinner-custom::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
}

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
/* Enhanced Styles for v1.3 - Template Editor and Elegant Invoice */

/* Template Editor Styles */
.template-editor-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.template-settings-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.template-preview-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-container {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
}

.preview-frame {
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    transform-origin: top center;
}

/* Settings Accordion */
.accordion-button {
    background: #f8f9fa;
    border: none;
    font-weight: 500;
}

.accordion-button:not(.collapsed) {
    background: #e3f2fd;
    color: #0066cc;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    background: white;
}

/* Color Picker Enhancements */
.form-control-color {
    width: 50px;
    height: 38px;
    border-radius: 6px;
}

/* Range Slider */
.form-range {
    margin: 10px 0;
}

.form-range::-webkit-slider-thumb {
    background: #0066cc;
}

.form-range::-moz-range-thumb {
    background: #0066cc;
    border: none;
}

/* Elegant Invoice Print Styles Enhancement */
@media print {
    .elegant-invoice {
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .elegant-header {
        page-break-inside: avoid;
    }

    .elegant-tax-breakdown {
        page-break-inside: avoid;
    }
}

/* Professional Invoice Elements */
.elegant-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.elegant-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.elegant-header-section {
    position: relative;
    padding: 20px 0;
    min-height: 120px;
}

.elegant-logo-right {
    position: absolute;
    top: 0;
    right: 0;
    text-align: right;
}

.elegant-logo-left {
    position: absolute;
    top: 0;
    left: 0;
    text-align: left;
}

.elegant-logo-center {
    text-align: center;
    margin-bottom: 15px;
}

.elegant-company-info {
    max-width: 65%;
}

.elegant-company-info.full-width {
    max-width: 100%;
}

.elegant-logo-placeholder {
    width: 100px;
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.elegant-logo-placeholder:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.elegant-invoice-title {
    text-align: center;
    font-size: 24pt;
    font-weight: 700;
    margin: 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 15px;
}

.elegant-invoice-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    border-radius: 2px;
}

.elegant-meta-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 25px;
}

.elegant-customer-section {
    background: white;
    padding: 20px;
    border: 2px solid #0066cc;
    border-radius: 10px;
    margin-bottom: 25px;
    position: relative;
}

.elegant-customer-header {
    font-size: 14pt;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #0066cc;
    position: relative;
}

.elegant-customer-header::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced Tables */
.elegant-items-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #333;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.elegant-items-table th {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    padding: 12px 8px;
    font-size: 9pt;
    font-weight: 600;
    text-align: center;
    border: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elegant-items-table td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    font-size: 10pt;
    vertical-align: middle;
}

.elegant-items-table tbody tr:nth-child(even) {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
}

.elegant-items-table tbody tr:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Enhanced Tax Breakdown */
.elegant-tax-section {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.elegant-tax-title {
    font-size: 14pt;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    position: relative;
}

.elegant-tax-title::before {
    content: '📊';
    margin-right: 8px;
}

.elegant-tax-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #0066cc;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.elegant-tax-table th {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    padding: 10px 6px;
    font-size: 9pt;
    font-weight: 600;
    text-align: center;
    border: 1px solid #0066cc;
}

.elegant-tax-table td {
    padding: 8px 6px;
    border: 1px solid #e3f2fd;
    font-size: 9pt;
    text-align: center;
}

.elegant-tax-table .total-row {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    font-weight: 600;
    color: #0066cc;
}

/* Amount in Words Enhancement */
.elegant-amount-words {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255,193,7,0.2);
}

.elegant-amount-words::before {
    content: '💰';
    margin-right: 8px;
    font-size: 18px;
}

/* Totals Enhancement */
.elegant-totals-table {
    width: 100%;
    max-width: 300px;
    border-collapse: collapse;
    margin-left: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.elegant-totals-table td {
    padding: 8px 15px;
    border: 1px solid #333;
    font-size: 11pt;
}

.elegant-totals-table .total-row {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    font-weight: 600;
    font-size: 12pt;
}

.elegant-totals-table .payment-row {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    font-weight: 600;
}

.elegant-totals-table .balance-row {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    color: #721c24;
    font-weight: 600;
}

/* Terms and Conditions */
.elegant-terms-section {
    margin: 25px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f4fd 0%, #dae8fc 100%);
    border: 1px solid #0066cc;
    border-left: 5px solid #0066cc;
    border-radius: 8px;
}

.elegant-terms-title {
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 8px;
}

.elegant-terms-title::before {
    content: '📋';
    margin-right: 8px;
}

/* Signature Section */
.elegant-signatures {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.elegant-signature-box {
    width: 45%;
    text-align: center;
    padding-top: 60px;
    border-top: 2px solid #333;
    font-weight: 600;
    position: relative;
}

.elegant-signature-box::before {
    content: '✍️';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
}

/* Footer Enhancement */
.elegant-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
    text-align: center;
    font-size: 9pt;
    color: #666;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
}

/* Product Edit Enhancements */
.product-status-cards {
    margin-bottom: 20px;
}

.status-card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.edit-history-timeline {
    max-height: 300px;
    overflow-y: auto;
}

.timeline-item {
    padding: 10px;
    border-left: 3px solid #0066cc;
    margin-left: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

.quick-action-btn {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .elegant-header-section {
        min-height: auto;
    }

    .elegant-logo-right,
    .elegant-logo-left {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }

    .elegant-company-info {
        max-width: 100%;
        text-align: center;
    }

    .elegant-signatures {
        flex-direction: column;
        gap: 30px;
    }

    .elegant-signature-box {
        width: 100%;
    }

    .preview-frame {
        transform: scale(0.8) !important;
    }

    .template-settings-panel,
    .template-preview-panel {
        margin-bottom: 20px;
    }
}

/* Animation Enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.elegant-section {
    animation: fadeInUp 0.5s ease-out;
}

/* Print Optimization */
@media print {
    .elegant-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .elegant-items-table tbody tr:hover {
        background: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .elegant-invoice-title::after {
        background: #333 !important;
    }

    .template-editor-container,
    .template-settings-panel,
    .template-preview-panel {
        box-shadow: none !important;
        background: white !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .elegant-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .elegant-meta-info {
        background: #4a5568;
        border-color: #718096;
    }

    .elegant-customer-section {
        background: #2d3748;
        border-color: #0066cc;
    }

    .template-settings-panel,
    .template-preview-panel {
        background: #2d3748;
        color: #e2e8f0;
    }
}