/* Brokers Page Styles */

/* Hero Section */
.brokers-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0 60px;
    text-align: center;
}

.brokers-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.brokers-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filters Section */
.filters-section {
    background: #f8f9fa;
    padding: 40px 0;
    border-bottom: 1px solid #e9ecef;
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Brokers Section */
.brokers-section {
    padding: 60px 0;
}

.brokers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.brokers-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.view-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.view-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Brokers Grid */
.brokers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.brokers-grid.list-view {
    grid-template-columns: 1fr;
}

.brokers-grid.compare-view {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Broker Card */
.broker-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e9ecef;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    opacity: 0;
}

.broker-card:nth-child(1) { animation-delay: 0.1s; }
.broker-card:nth-child(2) { animation-delay: 0.2s; }
.broker-card:nth-child(3) { animation-delay: 0.3s; }
.broker-card:nth-child(4) { animation-delay: 0.4s; }
.broker-card:nth-child(5) { animation-delay: 0.5s; }
.broker-card:nth-child(6) { animation-delay: 0.6s; }
.broker-card:nth-child(n+7) { animation-delay: 0.7s; }

.broker-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.broker-card.featured {
    border: 2px solid #007bff;
}

.broker-card.featured::before {
    content: attr(data-featured-text);
    position: absolute;
    top: 15px;
    right: 15px;
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.broker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.broker-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.broker-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.broker-rating .stars {
    color: #ffc107;
}

.broker-rating .rating-number {
    font-weight: 600;
    color: #333;
}

.broker-rating .reviews-count {
    color: #666;
    font-size: 14px;
}

.broker-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.broker-features {
    margin-bottom: 20px;
}

.broker-features h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    background: #f8f9fa;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #e9ecef;
}

.broker-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.broker-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-visit {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    flex: 1;
    text-align: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
    position: relative;
}

.btn-visit:hover {
    background: #0056b3;
    color: white;
}

.btn-compare {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    flex: 1;
    text-align: center;
}

.btn-compare:hover {
    background: #1e7e34;
    color: white;
}

.btn-reviews {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    flex: 1;
    text-align: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
    position: relative;
}

.btn-reviews:hover {
    background: #545b62;
    color: white;
}

/* List View */
.broker-card.list-view {
    display: flex;
    align-items: center;
    gap: 30px;
}

.broker-card.list-view .broker-header {
    flex: 1;
}

.broker-card.list-view .broker-actions {
    flex-shrink: 0;
}

/* Comparison Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    display: none;
    padding: 10px 0;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .brokers-hero h1 {
        font-size: 2rem;
    }
    
    .brokers-hero p {
        font-size: 1rem;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }
    
    .brokers-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .brokers-grid {
        grid-template-columns: 1fr;
    }
    
    .broker-card.list-view {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .broker-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .comparison-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table thead {
        display: table-header-group;
    }
    
    .comparison-table tbody {
        display: table-row-group;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
        min-width: 120px;
    }
    
    /* Ensure table wrapper is scrollable */
    .comparison-container,
    div[style*="overflow-x"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .brokers-hero {
        padding: 80px 0 40px;
    }
    
    .brokers-hero h1 {
        font-size: 1.8rem;
    }
    
    .broker-card {
        padding: 20px;
    }
    
    .broker-stats {
        grid-template-columns: 1fr;
    }
    
    .view-options {
        flex-direction: column;
    }
    
    .view-btn {
        justify-content: center;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
}

/* Comparison Container */
.comparison-container {
    margin-top: 20px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.comparison-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

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

.comparison-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    background: white;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    border-color: #007bff;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1);
}

.comparison-stats {
    margin: 15px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    color: #333;
    font-weight: 500;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}
