/* ====================================
   Portal de Búsqueda - Google Places
   ==================================== */

:root {
    --primary-color: #4285f4;
    --primary-hover: #3367d6;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc05;
    --dark-color: #202124;
    --light-color: #f8f9fa;
    --border-color: #dadce0;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), #1a73e8);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.header h1 {
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

/* Search Card */
.search-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

/* Search Button */
.btn-search {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-search:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
}

.btn-search:disabled {
    background: #9aa0a6;
    cursor: not-allowed;
}

/* Results Card */
.results-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.results-count {
    background: var(--light-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #5f6368;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    background: var(--secondary-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-export:hover {
    background: #2d9144;
}

.btn-export.excel {
    background: #217346;
}

.btn-export.excel:hover {
    background: #1a5c38;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-color);
}

table.dataTable {
    border-collapse: collapse !important;
}

table.dataTable thead th {
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color) !important;
    padding: 0.75rem !important;
    font-weight: 600;
    color: var(--dark-color);
}

table.dataTable tbody td {
    padding: 0.75rem !important;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

table.dataTable tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* Rating Stars */
.rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.rating .stars {
    color: var(--warning-color);
}

.rating .value {
    font-weight: 500;
    margin-left: 0.25rem;
}

.rating .count {
    color: #5f6368;
    font-size: 0.85rem;
}

/* Links in table */
.table-link {
    color: var(--primary-color);
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

/* Status Badge */
.status-open {
    display: inline-block;
    background: #e6f4ea;
    color: var(--secondary-color);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-closed {
    display: inline-block;
    background: #fce8e6;
    color: var(--danger-color);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Details Button */
.btn-details {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: #5f6368;
    font-size: 1rem;
}

/* Modal Styles */
.modal-header {
    background: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h6 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detail-item {
    display: flex;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-weight: 500;
    min-width: 120px;
    color: #5f6368;
}

.detail-value {
    flex: 1;
}

.hours-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hours-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
}

.review-item {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 500;
}

.review-time {
    color: #5f6368;
    font-size: 0.85rem;
}

.review-text {
    font-size: 0.9rem;
    color: #444;
}

/* Alert Styles */
.alert-api-key {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-api-key h5 {
    color: #856404;
    margin: 0 0 0.5rem;
}

.alert-api-key p {
    margin: 0;
    color: #856404;
}

.alert-api-key code {
    background: rgba(0,0,0,0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }

    .search-card, .results-card {
        padding: 1rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-buttons {
        width: 100%;
    }

    .btn-export {
        flex: 1;
        justify-content: center;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.5rem !important;
        font-size: 0.85rem;
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #5f6368;
}

.no-results i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.no-results h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Custom Autocomplete Dropdown */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-hover);
    z-index: 10000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--light-color);
}

.suggestion-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.suggestion-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item.no-results {
    color: #5f6368;
    cursor: default;
}

.suggestion-item.no-results:hover {
    background: white;
}
