/* HVAC Lead Response Tracker Styles */

.hvac-modal.show {
    opacity: 1;
    visibility: visible;
}

.hvac-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.hvac-modal.show .hvac-modal-content {
    transform: scale(1);
}

.hvac-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
}

.hvac-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.hvac-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 8px;
}

.hvac-close-btn:hover {
    color: #2d3748;
    background: #f7fafc;
}

/* Attempt Card Styles */
.hvac-attempt-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.hvac-attempt-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.hvac-attempt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 15px;
    margin-bottom: 12px;
}

.hvac-attempt-field {
    display: flex;
    flex-direction: column;
}

.hvac-attempt-label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-attempt-input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.hvac-attempt-input:focus {
    border-color: #1d4ed8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.hvac-no-attempts {
    text-align: center;
    color: #a0aec0;
    padding: 50px 20px;
    font-size: 16px;
    font-style: italic;
}

/* Instructions Styles */
.hvac-instructions {
    background: white;
    padding: 25px;
    border-radius: 16px;
    margin-top: 30px;
    color: #4a5568;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.hvac-instructions h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 18px;
}

.hvac-instructions ul {
    list-style: none;
    padding-left: 0;
}

.hvac-instructions li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.hvac-instructions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

/* Table Row Highlights */
.hvac-success-highlight {
    background: #f0fdf4 !important;
}

.hvac-success-highlight:hover td {
    background: #dcfce7 !important;
}

.hvac-urgent-highlight {
    background: #fffbeb !important;
}

.hvac-urgent-highlight:hover td {
    background: #fef3c7 !important;
}

.hvac-emergency-highlight {
    background: #fef2f2 !important;
}

.hvac-emergency-highlight:hover td {
    background: #fee2e2 !important;
}

/* Column Specific Styling */
.hvac-col-customer-name { min-width: 150px; }
.hvac-col-lead-source { min-width: 140px; }
.hvac-col-date-received { min-width: 120px; }
.hvac-col-time-received { min-width: 110px; }
.hvac-col-date-responded { min-width: 120px; }
.hvac-col-time-first-response { min-width: 130px; }
.hvac-col-response-time { min-width: 140px; }
.hvac-col-attempts { min-width: 100px; }
.hvac-col-appointment-date { min-width: 130px; }
.hvac-col-contact-info { min-width: 140px; }
.hvac-col-urgency { min-width: 100px; }
.hvac-col-who-responded { min-width: 120px; }
.hvac-col-response-method { min-width: 130px; }
.hvac-col-result { min-width: 150px; }
.hvac-col-lost-reason { min-width: 130px; }
.hvac-col-notes { min-width: 200px; }

/* Responsive Design */
@media (max-width: 768px) {
    .hvac-tracker-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .hvac-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hvac-btn {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .hvac-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hvac-attempt-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .hvac-table-wrapper {
        max-height: 50vh;
    }
    
    .hvac-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .hvac-tracker-header h1 {
        font-size: 24px;
    }
    
    .hvac-dashboard-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .hvac-tracker-container {
        padding: 10px;
    }
    
    .hvac-table th, 
    .hvac-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .hvac-metric-card {
        padding: 20px;
    }
    
    .hvac-metric-value {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .hvac-controls,
    .hvac-modal,
    .hvac-instructions,
    .hvac-row-clear-btn,
    .hvac-cell-clear-btn {
        display: none !important;
    }
    
    .hvac-tracker-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .hvac-table {
        font-size: 10px;
    }
    
    .hvac-table th,
    .hvac-table td {
        padding: 4px;
        border: 1px solid #000;
    }
}ac-tracker-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border: 1px solid #e5e7eb;
    max-width: 100%;
    overflow-x: hidden;
}

.hvac-tracker-container * {
    box-sizing: border-box;
}

/* Disable text selection and right-click within the tracker */
.hvac-tracker-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection only in input fields and textareas */
.hvac-tracker-container input, 
.hvac-tracker-container textarea, 
.hvac-tracker-container select, 
.hvac-tracker-container .select2-search__field {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Header Styles */
.hvac-tracker-header {
    text-align: center;
    margin-bottom: 30px;
}

.hvac-logo {
    max-height: 80px;
    margin-bottom: 20px;
    object-fit: contain;
}

.hvac-tracker-header h1 {
    color: #1d4ed8;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hvac-tracker-header p {
    color: #718096;
    font-size: 16px;
}

/* Controls Styles */
.hvac-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.hvac-btn {
    background: #1d4ed8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
}

.hvac-btn:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.hvac-btn-secondary {
    background: #dc2626;
}

.hvac-btn-secondary:hover {
    background: #b91c1c;
}

.hvac-btn-danger {
    background: #7f1d1d;
}

.hvac-btn-danger:hover {
    background: #991b1b;
}

/* Table Styles */
.hvac-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hvac-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    position: relative;
}

.hvac-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1800px;
    background: white;
}

.hvac-table th, 
.hvac-table td {
    padding: 12px 8px;
    text-align: left;
    border-right: 1px solid #e2e8f0;
    position: relative;
    min-width: 120px;
}

.hvac-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #1d4ed8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hvac-table th.hvac-row-number {
    min-width: 80px;
}

.hvac-table td {
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f7fafc;
}

.hvac-table td:hover {
    background: #f8fafc;
}

.hvac-table tr:hover td {
    background: #f0fdf4;
}

/* Row Number Styles */
.hvac-row-number {
    background: #1d4ed8 !important;
    color: white !important;
    font-weight: 700;
    text-align: center;
    min-width: 80px;
    cursor: default;
    position: relative;
    padding: 8px 4px;
}

.hvac-row-number:hover {
    background: #1d4ed8 !important;
}

.hvac-row-clear-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #dc2626;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.hvac-row-clear-btn:hover {
    background: #b91c1c;
    opacity: 1;
    transform: scale(1.1);
}

.hvac-row-number:hover .hvac-row-clear-btn {
    opacity: 1;
}

/* Cell Input Styles */
.hvac-cell-input {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 35px);
    height: 100%;
    border: 3px solid #1d4ed8;
    padding: 8px;
    font-size: 13px;
    z-index: 10;
    background: white;
    border-radius: 4px;
    outline: none;
}

.hvac-cell-clear-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 30px;
    height: calc(100% - 6px);
    background: #dc2626;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    z-index: 15;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.hvac-cell-clear-btn:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.hvac-cell-clear-btn:active {
    background: #991b1b;
    transform: scale(0.95);
}

/* Select2 Custom Styling */
.hvac-tracker-container .select2-container--default .select2-selection--single {
    height: 38px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.hvac-tracker-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    padding-left: 8px;
    font-size: 13px;
}

.hvac-tracker-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.hvac-tracker-container .select2-container--open .select2-selection--single {
    border-color: #1d4ed8 !important;
}

.hvac-tracker-container .select2-dropdown {
    border: 2px solid #1d4ed8;
    border-radius: 8px;
    border-top: none;
}

.hvac-tracker-container .select2-container {
    width: 100% !important;
}

.hvac-cell-select2 {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 35px);
    z-index: 100;
}

/* Ensure Select2 dropdown appears above table */
.hvac-tracker-container .select2-container--open .select2-dropdown {
    z-index: 9999;
}

/* Attempts and Special Cells */
.hvac-attempts-cell {
    color: #1d4ed8;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.hvac-attempts-cell:hover {
    color: #1e40af;
    transform: scale(1.02);
}

.hvac-response-time-cell {
    background: #f8fafc;
    font-weight: 600;
    cursor: default;
}

/* Metrics Dashboard */
.hvac-metrics-dashboard {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.hvac-dashboard-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1d4ed8;
}

.hvac-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.hvac-metric-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hvac-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1d4ed8;
}

.hvac-metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hvac-metric-header {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-metric-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #2d3748;
}

.hvac-metric-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

.hvac-metric-detail {
    font-size: 12px;
    color: #a0aec0;
}

/* Modal Styles */
.hvac-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hvac-modal.show {
    opacity: 1;
    visibility: visible;
}

.hvac-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.hvac-modal.show .hvac-modal-content {
    transform: scale(1);
}

.hvac-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
}

.hvac-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.hvac-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 8px;
}

.hvac-close-btn:hover {
    color: #2d3748;
    background: #f7fafc;
}

/* Attempt Card Styles */
.hvac-attempt-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.hvac-attempt-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.hvac-attempt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 15px;
    margin-bottom: 12px;
}

.hvac-attempt-field {
    display: flex;
    flex-direction: column;
}

.hvac-attempt-label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-attempt-input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.hvac-attempt-input:focus {
    border-color: #1d4ed8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.hvac-no-attempts {
    text-align: center;
    color: #a0aec0;
    padding: 50px 20px;
    font-size: 16px;
    font-style: italic;
}

/* Instructions Styles */
.hvac-instructions {
    background: white;
    padding: 25px;
    border-radius: 16px;
    margin-top: 30px;
    color: #4a5568;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.hvac-instructions h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 18px;
}

.hvac-instructions ul {
    list-style: none;
    padding-left: 0;
}

.hvac-instructions li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.hvac-instructions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

/* Table Row Highlights */
.hvac-success-highlight {
    background: #f0fdf4 !important;
}

.hvac-success-highlight:hover td {
    background: #dcfce7 !important;
}

.hvac-urgent-highlight {
    background: #fffbeb !important;
}

.hvac-urgent-highlight:hover td {
    background: #fef3c7 !important;
}

.hvac-emergency-highlight {
    background: #fef2f2 !important;
}

.hvac-emergency-highlight:hover td {
    background: #fee2e2 !important;
}

.select2-container {
    z-index: 99999999;
    font-size: 16px;
}

/* Column Specific Styling */
.hvac-col-customer-name { min-width: 150px; }
.hvac-col-lead-source { min-width: 140px; }
.hvac-col-date-received { min-width: 120px; }
.hvac-col-time-received { min-width: 110px; }
.hvac-col-date-responded { min-width: 120px; }
.hvac-col-time-first-response { min-width: 130px; }
.hvac-col-response-time { min-width: 140px; }
.hvac-col-attempts { min-width: 100px; }
.hvac-col-appointment-date { min-width: 130px; }
.hvac-col-contact-info { min-width: 140px; }
.hvac-col-urgency { min-width: 100px; }
.hvac-col-who-responded { min-width: 120px; }
.hvac-col-response-method { min-width: 130px; }
.hvac-col-result { min-width: 150px; }
.hvac-col-lost-reason { min-width: 130px; }
.hvac-col-notes { min-width: 200px; }

/* Responsive Design */
@media (max-width: 768px) {
    .hvac-tracker-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .hvac-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hvac-btn {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .hvac-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hvac-attempt-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .hvac-table-wrapper {
        max-height: 50vh;
    }
    
    .hvac-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .hvac-tracker-header h1 {
        font-size: 24px;
    }
    
    .hvac-dashboard-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .hvac-tracker-container {
        padding: 10px;
    }
    
    .hvac-table th, 
    .hvac-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .hvac-metric-card {
        padding: 20px;
    }
    
    .hvac-metric-value {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .hvac-controls,
    .hvac-modal,
    .hvac-instructions,
    .hvac-row-clear-btn,
    .hvac-cell-clear-btn {
        display: none !important;
    }
    
    .hvac-tracker-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .hvac-table {
        font-size: 10px;
    }
    
    .hvac-table th,
    .hvac-table td {
        padding: 4px;
        border: 1px solid #000;
    }
}