/* Invoice Generator Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --purple-color: #6f42c1;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.template-card.selected {
    border-width: 2px;
    box-shadow: 0 0 0 2px var(--primary-color) inset;
}

/* Invoice Sidebar */
.invoice-sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.invoice-sidebar h5 {
    color: var(--dark-color);
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
}

.form-label {
    color: var(--dark-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-select, .form-control {
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 10px 12px;
    transition: var(--transition);
}

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

/* Invoice Editor */
.invoice-editor {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.invoice-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.logo-placeholder {
    width: 150px;
    height: 80px;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.logo-placeholder:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.logo-preview {
    width: 150px;
    height: 80px;
    border-radius: var(--border-radius);
    object-fit: contain;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.invoice-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0;
}

.invoice-meta {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Bill To Section */
.bill-to-section {
    background: #fafbfc;
}

/* Invoice Items Table */
.invoice-items {
    background: white;
}

.table th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 15px 10px;
}

.table td {
    border: none;
    padding: 15px 10px;
    vertical-align: middle;
}

.table tbody tr {
    border-bottom: 1px solid #f1f3f4;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.item-input {
    border: none;
    background: transparent;
    padding: 8px;
    width: 100%;
}

.item-input:focus {
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    outline: none;
}

.qty-input, .rate-input {
    text-align: center;
    width: 80px;
}

.amount-display {
    font-weight: 600;
    color: var(--success-color);
}

/* Invoice Totals */
.invoice-totals {
    background: #fafbfc;
}

.totals-table {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.totals-table .row {
    margin-bottom: 8px;
    padding: 5px 0;
}

.totals-table .border-top {
    border-top: 2px solid var(--primary-color) !important;
    margin-top: 15px;
    padding-top: 15px;
}

/* Features Section */
.features-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.feature-card {
    transition: var(--transition);
    border: 1px solid #e9ecef;
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    background: #f8f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* FAQ Section */
.faq-section {
    background: white;
}

.accordion-button {
    font-weight: 600;
    color: var(--dark-color);
}

.accordion-button:not(.collapsed) {
    background-color: #f8f9ff;
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 10px 20px;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
}

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

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
    transform: translateY(-1px);
}

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

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

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

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

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

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

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.action-btn:hover {
    background: #ffebee;
    color: #c62828;
}

/* Utility Classes */
.text-purple {
    color: var(--purple-color) !important;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 1020;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .invoice-title {
        font-size: 2rem;
    }
    
    .invoice-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .feature-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .qty-input, .rate-input {
        width: 60px;
    }
    
    .invoice-meta .row {
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .invoice-editor {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .invoice-sidebar {
        margin: 0 -15px 20px;
        border-radius: 0;
    }
    
    .hero-section .container {
        padding: 0 15px;
    }
}

/* Print Styles */
@media print {
    .invoice-sidebar,
    .hero-section,
    .features-section,
    .faq-section,
    header,
    footer {
        display: none !important;
    }
    
    .invoice-editor {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .col-lg-9 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body {
        background: white;
    }
}

/* Loading Animation */
.loading {
    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); }
}

/* Success Animation */
.success-checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    text-align: center;
    line-height: 20px;
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Tooltip Styles */
.tooltip-inner {
    background-color: var(--dark-color);
    color: white;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--dark-color);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--dark-color);
}

/* Custom Scrollbar */
.invoice-sidebar::-webkit-scrollbar {
    width: 6px;
}

.invoice-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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