/* BlueGray Theme - Enformics Property Tax System */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    color: #1e3a5f;
    font-size: 24px;
}

.header-left .subtitle {
    color: #718096;
    font-size: 14px;
}

.header-right {
    text-align: right;
}

.tax-rate {
    background: #ebf4ff;
    color: #2b6cb0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s;
}

.back-button:hover {
    background: #e2e8f0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #1e3a5f;
    color: white;
}

.btn-primary:hover {
    background: #2c5282;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1a202c;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: #718096;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
}

.portal-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e3a5f;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-button:hover {
    background: #2c5282;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th {
    background: #f7fafc;
    color: #2d3748;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.results-table tr:hover {
    background: #f7fafc;
}

.results-table a {
    color: #2b6cb0;
    text-decoration: none;
}

.results-table a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    
    /* Stack tax analysis 4-box grid on mobile */
    .detail-card > div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    
    /* Stack tax analysis grid on mobile */
    .tax-analysis-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}
    
    /* Stack property detail grid on mobile */
    .detail-grid, .property-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Make tables scroll horizontally on mobile */
    .table-container, .comps-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .results-table, .comps-table {
        min-width: 900px !important;
    }
    
    /* Reduce padding on mobile */
    .detail-card {
        padding: 12px !important;
    }
    
    /* Stack header elements */
    .header-left h1 {
        font-size: 1.3em !important;
    }
    
    .subtitle {
        font-size: 0.95em !important;
    }
    
    /* Smaller font for savings boxes */
    .tax-savings-box, .savings-box {
        padding: 15px !important;
    }
    
    /* Ensure footer is readable */
    .footer {
        font-size: 0.85em !important;
        padding: 15px !important;
    }
}
    .header-right {
        text-align: center;
    }
    .header-left {
        flex-direction: column;
    }
    .results-table {
        font-size: 12px;
    }
    .results-table th, .results-table td {
        padding: 6px 8px;
    }
}

/* ==========================================================================
   ENFORMICS UNIFIED LAYOUT CLASSES (Property Detail Page)
   ========================================================================== */

.detail-grid, .property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f7fafc;
    border-radius: 8px;
}

.detail-card, .property-item {
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #1e3a5f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-width: 0;
}

.detail-card label, .property-item label {
    font-weight: 600;
    color: #718096;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.detail-card .value, .property-item .value {
    font-size: 1.1em;
    color: #1a202c;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tax-savings-box, .savings-box {
    background: #ebf4ff;
    border: 1px solid #bee3f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.tax-savings-box.no-savings {
    background: #f0fff4;
    border-color: #c6f6d5;
}

.comps-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.comps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comps-table th {
    background: #f7fafc;
    color: #2d3748;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.comps-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1a202c;
}

.comps-table tr:hover {
    background: #f7fafc;
}

.comps-table a {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 500;
}

.comps-table a:hover {
    text-decoration: underline;
}

.distance-badge, .class-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.distance-badge {
    background: #edf2f7;
    color: #4a5568;
}

.class-badge {
    background: #e2e8f0;
    color: #2d3748;
}

/* ==========================================================================
   CAMERON SPECIFIC & UNIFIED ADDITIONS
   ========================================================================== */

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

.legal-description {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 5px;
}

.methodology-note {
    font-size: 0.85em;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 10px;
}

.optional-field {
    color: #95a5a6;
    font-size: 0.9em;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.text-right {
    text-align: right;
}

/* Savings Box Grid */
.savings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.savings-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 4px;
}
.savings-item .label {
    font-size: 0.85em;
    color: #7f8c8d;
    display: block;
    margin-bottom: 5px;
}
.savings-item .savings-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #27ae60;
}

/* Subject Row in Tables */
.subject-row {
    background-color: #f8f9fa !important;
    font-weight: 600;
}
.subject-row td {
    border-top: 2px solid #3498db;
}

/* Portal Links */
.portal-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.portal-link, .zillow-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.2s;
}
.portal-link:hover, .zillow-link:hover {
    background: #bdc3c7;
}

.floating-cad-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s;
    z-index: 1000;
}
.floating-cad-button:hover {
    background: #219150;
    transform: translateY(-2px);
}

/* Classification Banners */
.classification-banner {
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
}
.classification-banner h3 {
    margin-top: 0;
    margin-bottom: 10px;
}
.classification-banner p {
    margin: 10px 0;
}
.parent-child-banner {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}
.parent-child-banner h3 { color: #856404; }
.parent-child-banner p { color: #5d4037; }

.divided-interest-banner {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}
.divided-interest-banner h3 { color: #1565c0; }
.divided-interest-banner p { color: #1976d2; }

.linked-properties-box {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}
.linked-properties-box ul {
    margin: 10px 0;
    padding-left: 20px;
}
.linked-properties-box li {
    margin: 8px 0;
}

.aggregate-total-box {
    background-color: #d5f4e6;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 3px solid #4caf50;
}

.pid-link-inline {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}
.pid-link-inline:hover { text-decoration: underline; }

.improvements-value {
    font-size: 0.9em !important;
    color: #555 !important;
    font-style: italic;
}

/* Ensure property-grid and property-item are robustly defined */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f7fafc;
    border-radius: 8px;
}
.property-item {
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #1e3a5f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-width: 0;
}
.property-item label {
    font-weight: 600;
    color: #718096;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}
.property-item .value {
    font-size: 1.1em;
    color: #1a202c;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* Tax Analysis 4-Box Grid */
.tax-analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    text-align: center;
    margin: 20px 0;
}

.tax-analysis-grid .box {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
}

.tax-analysis-grid .box.savings {
    background: #e6fffa;
    border: 2px solid #38b2ac;
}

.tax-analysis-grid .box .label {
    font-size: 0.75em;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.tax-analysis-grid .box.savings .label {
    color: #2c7a7b;
}

.tax-analysis-grid .box .value {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a202c;
}

.tax-analysis-grid .box.savings .value {
    color: #234e52;
}


/* ==========================================================================
   MOBILE OVERRIDE - MUST BE AT END TO OVERRIDE BASE RULES
   ========================================================================== */
@media (max-width: 768px) {
    .tax-analysis-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .tax-analysis-grid .box {
        width: 100% !important;
    }
}

/* Floating CAD Portal Button */
.floating-cad-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-cad-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.floating-cad-btn i {
    font-size: 16px;
}

/* Mobile Responsive Value Cards Grid */
@media (max-width: 768px) {
    .value-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .value-cards-grid > div {
        padding: 16px !important;
    }
    
    .value-cards-grid > div > div:first-child {
        font-size: 12px !important;
    }
    
    .value-cards-grid > div > div:last-child {
        font-size: 20px !important;
    }
}

/* Tablet Responsive (2 columns) */
@media (min-width: 769px) and (max-width: 1024px) {
    .value-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
