/* Stanis Directory Search - Frontend Styles */

/* Main container */
#stanis-directory-search {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* Search form styles */
#stanis-search-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stanis-search-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stanis-search-field {
    flex: 1;
    min-width: 250px;
    display: grid;
}

.stanis-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.stanis-search-field input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.stanis-search-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
}

/* Proximity search styles */
.stanis-proximity-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 10px;
}

.stanis-proximity-checkbox {
    display: flex;
    align-items: center;
}

.stanis-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.stanis-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.stanis-distance-field {
    min-width: 150px !important;
}

.stanis-distance-field select {
    background-color: #f8f9fa;
    border: 2px solid #007cba;
    /* border: 1px solid #ddd; */
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.stanis-search-field input:focus,
.stanis-search-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.stanis-search-buttons {
    text-align: center;
    margin-top: 20px;
}

.stanis-search-btn,
.stanis-clear-btn {
    padding: 12px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.stanis-search-btn {
    background-color: #007cba;
    color: white;
}

.stanis-search-btn:hover {
    background-color: #005a87;
}

.stanis-clear-btn {
    background-color: #666;
    color: white;
}

.stanis-clear-btn:hover {
    background-color: #444;
}

/* Loading indicator */
#stanis-search-loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

/* Results container */
.stanis-results-container {
    margin-top: 30px;
}

.stanis-results-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.stanis-results-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.stanis-print-btn {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stanis-print-btn:hover {
    background-color: #005a87;
}

.stanis-print-btn:before {
    content: "🖨️";
    font-size: 16px;
}

.stanis-proximity-info {
    margin: 5px 0 0 0;
    color: #666;
    font-style: italic;
    font-size: 14px;
    flex-basis: 100%;
}

/* Results grid */
.stanis-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Dentist card */
.stanis-dentist-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.stanis-dentist-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stanis-dentist-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.stanis-dentist-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.stanis-distance, .stanis-language {
    margin-top: 8px;
}

.stanis-distance-badge {
    background-color: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}
    color: #333;
    line-height: 1.3;
}

.stanis-specialty {
    color: #007cba;
    font-weight: normal;
}

.stanis-practice-name {
    margin: 5px 0 0 0;
    color: #666;
    font-style: italic;
}

/* Detail items */
.stanis-dentist-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stanis-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.stanis-label {
    font-weight: bold;
    color: #333;
    min-width: 80px;
    flex-shrink: 0;
}

.stanis-value {
    color: #555;
    line-height: 1.4;
}

.stanis-value a {
    color: #007cba;
    text-decoration: none;
}

.stanis-value a:hover {
    text-decoration: underline;
}

/* Maps link styling */
.stanis-maps-link {
    color: #007cba !important;
    text-decoration: none;
    border-bottom: 1px dotted #007cba;
    transition: all 0.3s ease;
}

.stanis-maps-link:hover {
    color: #005a87 !important;
    text-decoration: none;
    border-bottom: 1px solid #005a87;
    background-color: rgba(0, 124, 186, 0.05);
}

/* No results message */
.stanis-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.stanis-no-results p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .stanis-search-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .stanis-search-field {
        min-width: auto;
    }
    
    .stanis-results-grid {
        grid-template-columns: 1fr;
    }
    
    .stanis-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stanis-print-btn {
        align-self: stretch;
        justify-content: center;
    }
    
    .stanis-search-buttons {
        text-align: center;
    }
    
    .stanis-search-btn,
    .stanis-clear-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .stanis-detail-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .stanis-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    #stanis-directory-search {
        padding: 10px;
    }
    
    #stanis-search-form {
        padding: 20px;
    }
    
    .stanis-dentist-card {
        padding: 15px;
    }
}

/* Print styles */
@media print {
    /* Disable browser headers and footers */
    @page {
        margin: 0.5in;
        size: auto;
        /* Remove headers and footers */
        @top-left { content: none; }
        @top-center { content: none; }
        @top-right { content: none; }
        @bottom-left { content: none; }
        @bottom-center { content: none; }
        @bottom-right { content: none; }
    }
    
    /* Alternative method for hiding headers/footers */
    html {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    /* Hide non-essential elements when printing */
    .stanis-print-btn,
    .no-print {
        display: none !important;
    }
    
    /* Print layout for dentist cards with QR codes */
    .dentist-card {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        break-inside: avoid;
        page-break-inside: avoid;
        min-height: 100px;
    }
    
    .dentist-card-content {
        flex: 1;
        min-width: 0; /* Allow content to shrink */
    }
    
    .dentist-qr-code {
        flex-shrink: 0;
        width: 100px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .qr-code-img {
        width: 80px;
        height: 80px;
        margin-bottom: 5px;
    }
    
    .qr-label {
        font-size: 10px;
        color: #666;
        text-align: center;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    
    .qr-backup {
        font-size: 8px;
        color: #999;
        text-align: center;
        line-height: 1.1;
    }
    
    /* Ensure two-column layout for print */
    .print-content {
        column-count: 2;
        column-gap: 30px;
        column-fill: balance;
    }
    
    .dentist-name {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 8px;
    }
    
    .detail-item {
        font-size: 11px;
        margin-bottom: 4px;
        line-height: 1.3;
    }
    
    .detail-label {
        font-weight: bold;
        color: #333;
    }
    
    /* Print-specific typography */
    body {
        font-size: 11px;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    /* Print-specific maps link styling */
    .maps-link {
        color: #0066cc;
        text-decoration: none;
    }
    
    .maps-link:after {
        content: " (QR code →)";
        font-size: 9px;
        color: #666;
    }
}
