/**
 * DSI Quotes Manager - Frontend Styles
 * Customer quotes listing and sidebar slider
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */

.dsi-quotes-wrapper {
    margin: 0 auto;
    max-width: 1200px;
}

.dsi-quotes-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: #119fb4;
}

.dsi-quotes-page-title .material-icons {
    font-size: 32px;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.dsi-quotes-statistics {
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    height: 100%;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons {
    font-size: 32px;
    color: #fff;
}

.stat-card-primary .stat-icon {
    background: linear-gradient(135deg, #119fb4 0%, #12a8be 100%);
}

.stat-card-warning .stat-icon {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.stat-card-info .stat-icon {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.dsi-quotes-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dsi-quotes-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dsi-quotes-actions .btn .material-icons {
    font-size: 20px;
}

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

/* ============================================
   QUOTES TABLE
   ============================================ */

.dsi-quotes-table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dsi-quotes-table-card .card-header {
    background: linear-gradient(135deg, #119fb4 0%, #12a8be 100%);
    color: #fff;
    padding: 20px;
    border: none;
}

.dsi-quotes-table-card .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.dsi-quotes-table {
    margin: 0;
}

.dsi-quotes-table thead th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    padding: 15px;
}

.dsi-quotes-table tbody tr {
    transition: background-color 0.2s ease;
}

.dsi-quotes-table tbody tr:hover {
    background-color: #f0f8ff;
}

.dsi-quotes-table tbody td {
    vertical-align: middle;
    padding: 15px;
}

.quote-date {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
}

.quote-date .material-icons {
    font-size: 16px;
}

.quote-amount {
    color: #119fb4;
    font-size: 16px;
}

.btn-view-quote {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-view-quote .material-icons {
    font-size: 16px;
}

/* ============================================
   NO QUOTES ALERT
   ============================================ */

.dsi-no-quotes-alert {
    border: none;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.dsi-no-quotes-alert .alert-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dsi-no-quotes-alert .material-icons {
    font-size: 64px;
    color: #119fb4;
}

.dsi-no-quotes-alert h4 {
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

.dsi-no-quotes-alert p {
    color: #7f8c8d;
    margin: 0;
}

/* ============================================
   SIDEBAR SLIDER
   ============================================ */

.dsi-quotes-sidebar {
    position: fixed;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: left 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.dsi-quotes-sidebar.active {
    left: 0;
}

/* Sidebar Header */
.dsi-sidebar-header {
    background: linear-gradient(135deg, #119fb4 0%, #12a8be 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.dsi-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.dsi-sidebar-title .material-icons {
    font-size: 24px;
}

.dsi-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dsi-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.dsi-sidebar-close .material-icons {
    font-size: 24px;
}

/* Sidebar Filters */
.dsi-sidebar-filters {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.filter-group .btn-primary {
    background: #119fb4;
    border-color: #119fb4;
    border-radius: 0 8px 8px 0;
}

.filter-group .btn-primary:hover {
    background: #0d7a8a;
    border-color: #0d7a8a;
}

/* Sidebar Content */
.dsi-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.dsi-sidebar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7f8c8d;
}

.loading-text {
    margin-top: 15px;
    font-size: 14px;
}

/* Quote Item in Sidebar */
.dsi-quote-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dsi-quote-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.quote-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.quote-number {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
}

.quote-number .material-icons {
    font-size: 20px;
    color: #119fb4;
}

.quote-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-item-body {
    margin-bottom: 12px;
}

.quote-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.quote-info-row:last-child {
    margin-bottom: 0;
}

.quote-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-size: 13px;
}

.quote-info-item .material-icons {
    font-size: 16px;
}

.quote-info-item.quote-amount {
    color: #119fb4;
    font-size: 15px;
}

.quote-item-footer {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.quote-item-footer .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    padding: 8px 12px;
}

.quote-item-footer .material-icons {
    font-size: 16px;
}

/* Sidebar Footer */
.dsi-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* Sidebar Overlay */
.dsi-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.dsi-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   BADGES
   ============================================ */

.badge-pill {
    border-radius: 12px;
    padding: 5px 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pill .material-icons {
    font-size: 14px;
}

.badge-primary {
    background: #119fb4;
    color: #fff;
}

.badge-secondary {
    background: #95a5a6;
    color: #fff;
}

.badge-success {
    background: #27ae60;
    color: #fff;
}

.badge-danger {
    background: #e74c3c;
    color: #fff;
}

.badge-warning {
    background: #f39c12;
    color: #fff;
}

.badge-info {
    background: #3498db;
    color: #fff;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .dsi-quotes-sidebar {
        width: 50%;
        left: -50%;
    }
}

@media (max-width: 768px) {
    .dsi-quotes-sidebar {
        width: 80%;
        left: -80%;
    }

    .stat-card {
        margin-bottom: 15px;
    }

    .dsi-quotes-actions {
        flex-direction: column;
    }

    .dsi-quotes-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .dsi-quotes-sidebar {
        width: 90%;
        left: -90%;
    }

    .dsi-quotes-table {
        font-size: 12px;
    }

    .dsi-quotes-table thead th,
    .dsi-quotes-table tbody td {
        padding: 10px 5px;
    }

    .quote-item-footer {
        flex-direction: column;
    }

    .quote-item-footer .btn {
        width: 100%;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.dsi-sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.dsi-sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dsi-sidebar-content::-webkit-scrollbar-thumb {
    background: #119fb4;
    border-radius: 4px;
}

.dsi-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #0d7a8a;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}


/* ============================================
   QUOTE BUTTON LOADING STATES
   ============================================ */

.dsi-quote-btn .btn-loader,
.dsi-quote-icon-btn .icon-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dsi-quote-btn.loading,
.dsi-quote-icon-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.dsi-quote-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.dsi-quote-loading-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dsi-quote-loading-content .spinner {
    margin-bottom: 20px;
}

.dsi-quote-loading-content .material-icons {
    font-size: 48px;
    color: #119fb4;
}

.dsi-quote-loading-content p {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

/* ============================================
   SUCCESS MODAL
   ============================================ */

.dsi-quote-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dsi-quote-success-modal.show {
    opacity: 1;
}

.dsi-quote-success-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.dsi-quote-success-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header .success-icon {
    font-size: 64px;
    color: #27ae60;
    margin-bottom: 10px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
}

.modal-body {
    padding: 30px;
}

.quote-message {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.quote-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.quote-info .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.quote-info .info-item strong {
    color: #2c3e50;
}

.quote-info .info-item span {
    color: #7f8c8d;
}

.quote-info .badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-footer .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.modal-footer .btn .material-icons {
    font-size: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 576px) {
    .dsi-quote-loading-content {
        padding: 30px 20px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header {
        padding: 20px 20px 15px;
    }

    .modal-header .success-icon {
        font-size: 48px;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 15px 20px 20px;
    }

    .modal-footer .btn {
        width: 100%;
    }
}




/* ============================================
   PAGE FILTERS
   ============================================ */

.dsi-quotes-filters {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.dsi-quotes-filters .card-header {
    background: linear-gradient(135deg, #119fb4 0%, #12a8be 100%);
    color: #fff;
    padding: 20px;
    border: none;
}

.dsi-quotes-filters .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.dsi-quotes-filters .card-body {
    padding: 25px;
}

.dsi-quotes-filters .row {
    margin: 0 -10px;
}

.dsi-quotes-filters .col-md-4 {
    padding: 0 10px;
}

.dsi-quotes-filters .filter-group {
    margin-bottom: 0;
}

.dsi-quotes-filters .filter-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dsi-quotes-filters .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    font-size: 14px;
    height: auto;
    transition: border-color 0.3s ease;
}

.dsi-quotes-filters .form-control:focus {
    border-color: #119fb4;
    box-shadow: 0 0 0 0.2rem rgba(17, 159, 180, 0.25);
}

.dsi-quotes-filters .input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dsi-quotes-filters .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(17, 159, 180, 0.25);
}

.dsi-quotes-filters .btn-primary {
    background: #119fb4;
    border-color: #119fb4;
    border-radius: 0 8px 8px 0;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dsi-quotes-filters .btn-primary:hover {
    background: #0d7a8a;
    border-color: #0d7a8a;
    transform: translateY(-1px);
}

.dsi-quotes-filters .btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(17, 159, 180, 0.25);
}

/* ============================================
   AJAX FILTERED RESULTS
   ============================================ */

.dsi-filtered-results {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.dsi-filtered-results.loading {
    opacity: 0.7;
    pointer-events: none;
}

.dsi-filtered-results.loading .dsi-quotes-table-card {
    position: relative;
}

.dsi-filtered-results.loading .dsi-quotes-table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 12px;
}

.dsi-filtered-results.loading .dsi-quotes-table-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #119fb4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}