/* Custom CSS for GST E-Invoice Generator */

: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 {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.section-pagination {
    display: flex;
    align-items: center;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.pagination-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 80px;
}

.pagination-step:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #dee2e6;
    border: 2px solid #adb5bd;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.pagination-step.active .step-dot {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.pagination-step.completed .step-dot {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.pagination-step.completed .step-dot::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.step-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    transition: color 0.3s ease;
}

.pagination-step.active .step-name {
    color: var(--primary-color);
    font-weight: 600;
}

.pagination-step.completed .step-name {
    color: var(--success-color);
    font-weight: 600;
}

.pagination-line {
    width: 40px;
    height: 2px;
    background-color: #dee2e6;
    margin: 0 0.5rem;
    margin-top: -16px;
    transition: background-color 0.3s ease;
}

.pagination-line.completed {
    background-color: var(--success-color);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* Main Content Styles */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .section-pagination {
        padding: 1rem;
        overflow-x: auto;
        min-width: 100%;
    }
    
    .pagination-step {
        min-width: 60px;
        flex-shrink: 0;
    }
    
    .step-name {
        font-size: 0.65rem;
    }
    
    .pagination-line {
        width: 30px;
    }
}

/* Enhanced Validation Styling */
.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='%23198754'%3e%3cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.2rem 1.2rem !important;
    padding-right: 3rem !important;
    box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.15) !important;
    animation: validPulse 0.3s ease-in-out;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='%23dc3545'%3e%3cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3e%3cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.2rem 1.2rem !important;
    padding-right: 3rem !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15) !important;
    animation: invalidShake 0.3s ease-in-out;
}

/* Animation effects */
@keyframes validPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25) !important; }
    100% { transform: scale(1); }
}

@keyframes invalidShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Validation Icon Styling */
.validation-icon {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 1.2rem !important;
    pointer-events: none !important;
    z-index: 10 !important;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

.success-icon {
    color: #198754 !important;
    animation: iconFadeIn 0.3s ease-in-out;
}

.error-icon {
    color: #dc3545 !important;
    animation: iconPulse 0.5s ease-in-out;
}

@keyframes iconFadeIn {
    0% { opacity: 0; transform: translateY(-50%) scale(0.5); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

@keyframes iconPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* Ensure parent containers are relative */
.form-group {
    position: relative;
}

/* Override Bootstrap validation styles to work with our icons */
.form-control.is-valid {
    background-image: none !important;
    padding-right: 2.5rem !important;
}

.form-control.is-invalid {
    background-image: none !important;
    padding-right: 2.5rem !important;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Enhanced feedback styling */
.invalid-feedback {
    display: block !important;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
    font-weight: 500;
}

.valid-feedback {
    display: block !important;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

/* Make validation icons more prominent */
.position-relative .form-control.is-valid,
.position-relative .form-control.is-invalid {
    background-position: right 0.75rem center !important;
}

/* Custom success and error states */
.field-success {
    border-left: 4px solid var(--success-color);
    background-color: rgba(25, 135, 84, 0.05);
}

.field-error {
    border-left: 4px solid var(--danger-color);
    background-color: rgba(220, 53, 69, 0.05);
}

.section-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
    font-weight: 600;
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

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

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.675rem 0.75rem;
    transition: all 0.15s ease-in-out;
}

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

.btn {
    border-radius: 8px;
    padding: 0.675rem 1.25rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.item-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    position: relative;
    transition: all 0.15s ease-in-out;
}

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

.item-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    margin: -1rem -1rem 1rem -1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #dee2e6;
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.tax-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.validation-error {
    border-color: var(--danger-color) !important;
}

.validation-success {
    border-color: var(--success-color) !important;
}

.summary-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.summary-table tr:last-child {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
}

.alert {
    border: none;
    border-radius: 10px;
}

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.progress {
    height: 4px;
    border-radius: 2px;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .item-card {
        padding: 0.75rem;
    }
    
    .remove-item-btn {
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .card-header .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    body {
        background: white !important;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 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;
}

/* Highlight required fields */
.form-label .text-danger {
    font-size: 0.8rem;
}

/* Status indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-pending {
    background-color: var(--warning-color);
}

.status-valid {
    background-color: var(--success-color);
}

.status-invalid {
    background-color: var(--danger-color);
}

/* Item calculation display */
.calculation-row {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* HSN search dropdown */
.hsn-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hsn-dropdown-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
}

.hsn-dropdown-item:hover {
    background-color: #f8f9fa;
}

.hsn-dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Section progress indicator */
.section-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 20px;
    margin: 0 0.25rem;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.section-step.active {
    background: var(--primary-color);
    color: white;
}

.section-step.completed {
    background: var(--success-color);
    color: white;
}

/* Floating action buttons */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.fab:hover {
    transform: scale(1.1);
}

/* Tooltip enhancements */
.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Table enhancements */
.table {
    font-size: 0.9rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

/* Form validation states */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.94 1.94 3.72-3.72.94.94L3.24 8.44 2.3 6.73Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4m0-2.4L5.8 6.6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Footer Styles */
.footer {
    color: #6c757d;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-heart {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.made-text, .by-text {
    color: #6c757d;
    font-weight: 400;
}

.heart-icon {
    color: #ff6b6b;
    font-size: 1rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.servilo-link {
    text-decoration: none;
    color: #0d6efd;
    font-weight: 500;
    transition: color 0.3s ease;
}

.servilo-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.servilo-text {
    font-weight: 500;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-heart {
        font-size: 0.85rem;
        gap: 0.3rem;
    }
}
