/* Available Referrals Page Styling */

:root {
    --primary-navy: #0A2540;
    --primary-gold: #C9A961;
    --off-white: #F8F6F3;
    --light-gray: #F4F4F4;
    --medium-gray: #666;
    --dark-gray: #333;
    --success-green: #10B981;
    --error-red: #EF4444;
}

/* Referrals Hero Section */
.referrals-hero {
    background: linear-gradient(135deg, var(--primary-navy) 0%, #0d3154 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.referrals-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(201,169,97,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.referrals-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--primary-gold);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.filter-group label i {
    color: var(--primary-gold);
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: white;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--primary-gold);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.1);
}

#resetFilters {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

/* Referrals Section */
.referrals-section {
    padding: 4rem 0;
    background: var(--light-gray);
}

.referrals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Referral Card */
.referral-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.referral-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-navy) 0%, #0d3154 100%);
    color: white;
    padding: 1.5rem;
}

.card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-location i {
    color: var(--primary-gold);
}

.card-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-buyer {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.badge-seller {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.badge-both {
    background: rgba(201, 169, 97, 0.2);
    color: var(--primary-gold);
}

.quality-active {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.quality-verified {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.quality-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.quality-badge i {
    color: var(--primary-gold);
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.detail-item i {
    color: var(--primary-gold);
    font-size: 1.125rem;
    margin-top: 0.125rem;
}

.detail-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 0.25rem;
}

.detail-content p {
    font-size: 0.875rem;
    color: var(--medium-gray);
    line-height: 1.5;
}

.card-commission {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.commission-label {
    font-size: 0.75rem;
    color: var(--medium-gray);
    margin-bottom: 0.5rem;
}

.commission-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-green);
}

.commission-note {
    font-size: 0.75rem;
    color: var(--medium-gray);
    margin-top: 0.25rem;
}

.card-footer {
    padding: 1.5rem;
    background: var(--off-white);
    border-top: 1px solid #e5e7eb;
}

.accept-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-navy);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.accept-btn:hover {
    background: #0d3154;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 37, 64, 0.3);
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.loading-state i,
.empty-state i {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.loading-state i {
    animation: spin 1s linear infinite;
}

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

.empty-state h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--medium-gray);
    font-size: 1.125rem;
}

/* How It Works Section */
.how-it-works-section {
    padding: 5rem 0;
    background: white;
}

.how-it-works-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    text-align: center;
    color: var(--primary-navy);
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: var(--light-gray);
    transition: all 0.3s ease;
}

.step-card:hover {
    background: var(--off-white);
    transform: translateY(-4px);
}

.step-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background: var(--primary-gold);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-card i {
    font-size: 3rem;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.5rem;
    color: var(--primary-navy);
    margin-bottom: 0.75rem;
}

.step-card p {
    color: var(--medium-gray);
    line-height: 1.6;
}

/* Fee Structure Section */
.fee-structure-section {
    padding: 5rem 0;
    background: var(--light-gray);
}

.fee-structure-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    text-align: center;
    color: var(--primary-navy);
    margin-bottom: 3rem;
}

.fee-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.fee-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fee-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.fee-item i {
    font-size: 1.5rem;
    color: var(--success-green);
    flex-shrink: 0;
}

.fee-item h4 {
    font-size: 1.125rem;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.fee-item p {
    color: var(--medium-gray);
    line-height: 1.6;
}

.fee-example {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.fee-example h3 {
    font-size: 1.5rem;
    color: var(--primary-navy);
    margin-bottom: 1.5rem;
    text-align: center;
}

.example-card {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.example-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.example-row.highlight {
    background: rgba(201, 169, 97, 0.1);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 4px;
}

.example-row.success {
    background: rgba(16, 185, 129, 0.1);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 4px;
    font-size: 1.125rem;
}

.example-row strong {
    color: var(--primary-navy);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 800px;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--medium-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-navy);
}

.modal-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--medium-gray);
    margin-bottom: 2rem;
}

/* Form Styling */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block !important;
    position: static !important;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
    font-size: 12px !important;
    text-transform: none;
    letter-spacing: 0;
    left: auto !important;
    top: auto !important;
    background: transparent !important;
    padding: 0 !important;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px !important;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
    line-height: 1.4;
    min-height: auto;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: transparent;
    font-size: 0;
    opacity: 0;
}

/* Style empty select dropdowns to appear blank */
.form-group select:invalid {
    color: transparent;
}

.form-group select:valid {
    color: #111827;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.4;
}

/* Agreement Box */
.agreement-box {
    background: var(--off-white);
    border: 2px solid var(--primary-gold);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.agreement-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-navy);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.agreement-box h4 i {
    color: var(--primary-gold);
}

.agreement-box ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.agreement-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.agreement-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-top: 1rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
    line-height: 1.6;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-navy);
    color: white;
}

.btn-primary:hover {
    background: #0d3154;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 37, 64, 0.3);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark-gray);
}

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

/* Form Messages */
.form-message {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
}

.form-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.form-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.form-message.success h3 {
    color: var(--success-green);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-red);
}

.form-message.error h3 {
    color: var(--error-red);
}

/* Responsive Design */
@media (max-width: 968px) {
    .referrals-hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        width: 100%;
        justify-content: center;
    }
    
    .filters-wrapper {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    #resetFilters {
        width: 100%;
    }
    
    .referrals-grid {
        grid-template-columns: 1fr;
    }
    
    .fee-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Limited Availability Alert Section */
.limited-availability-alert {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 3rem 0;
    border-top: 3px solid var(--primary-gold);
    border-bottom: 3px solid var(--primary-gold);
}

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border-left: 6px solid #F59E0B;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-icon i {
    font-size: 3rem;
    color: #F59E0B;
}

.alert-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

.alert-content p {
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.alert-subtext {
    font-weight: 600;
    color: var(--primary-navy);
}

.alert-registration {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.alert-registration h4 {
    font-size: 1.5rem;
    color: var(--primary-navy);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-registration h4 i {
    color: var(--primary-gold);
}

.alert-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.alert-form .form-row.full-width {
    grid-template-columns: 1fr;
}

.alert-form .form-group {
    margin-bottom: 0;
}

.alert-form .form-group.full-width {
    grid-column: 1 / -1;
}

.alert-form input,
.alert-form select {
    width: 100%;
    padding: 10px !important;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px !important;
    transition: all 0.3s ease;
    background: white;
}

.alert-form input::placeholder {
    color: transparent !important;
    font-size: 0 !important;
    opacity: 0 !important;
}

.alert-form select:invalid {
    color: transparent !important;
}

.alert-form select:valid {
    color: #111827 !important;
    font-size: 14px !important;
}

.alert-form input:focus,
.alert-form select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.alert-preferences {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--off-white);
    border-radius: 8px;
}

.alert-preferences p {
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-gray);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-gold);
}

.btn-large {
    width: 100%;
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.alert-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--medium-gray);
    margin-top: 1rem;
    font-style: italic;
}

.alert-success-message {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-radius: 12px;
    border: 2px solid var(--success-green);
}

.alert-success-message i {
    font-size: 3rem;
    color: var(--success-green);
    margin-bottom: 1rem;
}

.alert-success-message h4 {
    font-size: 1.5rem;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.alert-success-message p {
    color: var(--dark-gray);
    font-size: 1rem;
}

@media (max-width: 640px) {
    .referrals-hero {
        padding: 100px 0 60px;
    }
    
    .referrals-hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    /* Limited Availability Alert - Mobile */
    .alert-box {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .alert-icon i {
        font-size: 2rem;
    }
    
    .alert-content h3 {
        font-size: 1.5rem;
    }
    
    .alert-registration {
        padding: 1.5rem;
    }
    
    .alert-registration h4 {
        font-size: 1.25rem;
    }
    
    .alert-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }
}
