/**
 * Custom styles for GoAtlas
 * Bootstrap 5 overrides and custom components
 */

:root {
    /* Brand colors */
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    
    /* Custom colors */
    --loko-orange: #fd7e14;
    --loko-green: #20c997;
    --loko-blue: #0d6efd;
    --loko-red: #dc3545;
    
    /* Spacing */
    --bs-border-radius: 0.375rem;
    --bs-border-radius-sm: 0.25rem;
    --bs-border-radius-lg: 0.5rem;
    --bs-border-radius-xl: 0.75rem;
    --bs-border-radius-2xl: 1rem;
    --bs-border-radius-3xl: 1.5rem;
    
    /* Shadows */
    --bs-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --bs-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --bs-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--bs-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* Buttons */
.btn {
    border-radius: var(--bs-border-radius);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--loko-blue);
    border-color: var(--loko-blue);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: var(--bs-shadow-lg);
}

.btn-outline-primary {
    color: var(--loko-blue);
    border-color: var(--loko-blue);
}

.btn-outline-primary:hover {
    background-color: var(--loko-blue);
    border-color: var(--loko-blue);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-shadow);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bs-shadow-lg);
}

.card-img-top {
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
    height: 200px;
    object-fit: cover;
}

/* Listing cards */
.listing-card {
    position: relative;
    overflow: hidden;
}

.listing-card .card-img-top {
    height: 180px;
    transition: transform 0.3s ease;
}

.listing-card:hover .card-img-top {
    transform: scale(1.05);
}

.listing-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

.listing-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--loko-green);
}

.listing-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-location {
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

.listing-date {
    font-size: 0.75rem;
    color: var(--bs-secondary);
}

/* Navigation */
.navbar {
    box-shadow: var(--bs-shadow);
    background-color: #fff !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--loko-blue) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--bs-dark) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--loko-blue) !important;
}

/* Search bar */
.search-container {
    position: relative;
}

.search-input {
    border-radius: var(--bs-border-radius-3xl);
    border: 2px solid var(--bs-light);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--loko-blue);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--bs-border-radius-3xl);
    padding: 0.5rem 1rem;
}

/* Forms */
.form-control {
    border-radius: var(--bs-border-radius);
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--loko-blue);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select {
    border-radius: var(--bs-border-radius);
    border: 1px solid #dee2e6;
}

.form-check-input:checked {
    background-color: var(--loko-blue);
    border-color: var(--loko-blue);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--bs-border-radius);
    font-weight: 500;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--bs-info);
}

/* Pagination */
.pagination {
    justify-content: center;
}

.page-link {
    border: none;
    color: var(--loko-blue);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--bs-border-radius);
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--loko-blue);
    color: white;
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: var(--loko-blue);
    border-color: var(--loko-blue);
}

/* Filters */
.filters-card {
    position: sticky;
    top: 2rem;
}

.filter-section {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--bs-dark);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--bs-secondary);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--bs-secondary);
    margin-bottom: 2rem;
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    border-radius: var(--bs-border-radius);
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.skeleton-image {
    height: 200px;
    border-radius: var(--bs-border-radius-lg);
}

/* Phone reveal */
.phone-reveal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--bs-border-radius-lg);
    padding: 1rem;
    text-align: center;
}

.phone-reveal:hover {
    transform: translateY(-2px);
    box-shadow: var(--bs-shadow-lg);
}

/* Favorites */
.favorite-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1.5rem;
}

/* Toasts */
.toast {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-shadow-lg);
}

.toast-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .search-input {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .listing-card .card-img-top {
        height: 150px;
    }
    
    .filters-card {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .listing-price {
        font-size: 1.1rem;
    }
    
    .listing-title {
        font-size: 0.9rem;
    }
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.border-radius-3 {
    border-radius: var(--bs-border-radius-3xl) !important;
}

.shadow-hover {
    transition: box-shadow 0.2s ease;
}

.shadow-hover:hover {
    box-shadow: var(--bs-shadow-lg);
}

/* Logo styles */
.brand-logo-img {
    max-height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

.brand-logo-img:hover {
    transform: scale(1.05);
}

/* Footer styles */
footer .text-light:hover {
    color: #ffffff !important;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

footer a.text-light:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Empty State Styles */
.empty-state {
    padding: 3rem 1rem;
    background: #f8f9fa;
    border-radius: var(--bs-border-radius-lg);
    margin: 2rem 0;
}

.empty-state-icon {
    opacity: 0.6;
}

.empty-state h3 {
    color: var(--bs-secondary);
    font-weight: 600;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .favorite-btn,
    .phone-reveal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}