/* Custom CSS untuk Broker.co.id */

/* Fresh Blue Color Scheme - Updated for Accessibility (WCAG AA Compliant) */
:root {
    --primary-blue: #2563eb;      /* blue-600 - darker for better contrast (was blue-500) */
    --primary-blue-light: #3b82f6; /* blue-500 */
    --primary-blue-dark: #1d4ed8;  /* blue-700 */
    --accent-blue: #0891b2;       /* cyan-600 - darker (was cyan-500) */
    --gradient-start: #7c3aed;    /* violet-600 */
    --gradient-end: #2563eb;      /* blue-600 */
    --text-primary: #1f2937;      /* gray-800 */
    --text-secondary: #6b7280;    /* gray-500 */
    --success-green: #10b981;     /* emerald-500 */
    --warning-orange: #f59e0b;    /* amber-500 */
}

/* Button Styles - Updated for Accessibility */
.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white font-medium transition-colors duration-200;
}

/* Hide scrollbar utility */
.scrollbar-hide {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    white-space: normal !important;
}

/* Enhanced line clamp for property cards */
.product-card-title.line-clamp-2 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
    white-space: normal !important;
    line-height: 1.4 !important;
}

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

/* Hero Slider Styles */
.hero-slider {
    @apply relative h-64 sm:h-80 lg:h-96 bg-gray-200 overflow-hidden;
}

.hero-slide {
    @apply absolute inset-0 opacity-0 transition-opacity duration-500 bg-cover bg-center bg-no-repeat;
}

.hero-slide.active {
    @apply opacity-100;
}

.hero-indicator.active {
    @apply bg-white bg-opacity-80;
}

/* Property Card Hover Effects */
.property-card {
    @apply transform transition-all duration-200 hover:scale-105 hover:shadow-xl;
}

/* Responsive Text Sizes */
@media (max-width: 640px) {
    .text-responsive-sm {
        @apply text-sm;
    }
    .text-responsive-base {
        @apply text-base;
    }
    .text-responsive-lg {
        @apply text-lg;
    }
}

/* Admin Panel Styles */
.admin-sidebar {
    background: linear-gradient(180deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
}

/* Loading Spinner */
.spinner {
    @apply animate-spin rounded-full h-8 w-8 border-b-2 border-primary;
}

.spinner-large {
    @apply animate-spin rounded-full h-12 w-12 border-b-2 border-primary;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Focus styles for accessibility */
.focus-primary:focus {
    @apply outline-none ring-2 ring-primary ring-offset-2;
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-hover:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Responsive Grid Adjustments */
@media (min-width: 1280px) {
    .property-grid-xl {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1536px) {
    .property-grid-2xl {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Form Input Styles */
.form-input {
    @apply block w-full border-gray-300 rounded-md shadow-sm focus:border-primary focus:ring focus:ring-primary focus:ring-opacity-50;
}

.form-select {
    @apply block w-full border-gray-300 rounded-md shadow-sm focus:border-primary focus:ring focus:ring-primary focus:ring-opacity-50;
}

.form-textarea {
    @apply block w-full border-gray-300 rounded-md shadow-sm focus:border-primary focus:ring focus:ring-primary focus:ring-opacity-50;
}

/* Alert Styles */
.alert {
    @apply px-4 py-3 rounded relative;
}

.alert-success {
    @apply bg-green-100 border border-green-400 text-green-700;
}

.alert-error {
    @apply bg-red-100 border border-red-400 text-red-700;
}

.alert-warning {
    @apply bg-yellow-100 border border-yellow-400 text-yellow-700;
}

.alert-info {
    @apply bg-blue-100 border border-blue-400 text-blue-700;
}

/* Mobile Menu Transitions */
.mobile-menu {
    @apply transform transition-transform duration-300 ease-in-out;
}

.mobile-menu.open {
    @apply translate-x-0;
}

.mobile-menu.closed {
    @apply -translate-x-full;
}

/* Badge Styles */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-primary {
    @apply bg-blue-100 text-blue-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Floating WhatsApp Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        @apply text-black bg-white;
    }
}

/* Dark mode preparations (for future use) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-blue: #60a5fa;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
}

#thumbnail-gallery::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.thumbnail {
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}

/* Image centering and full width */
#main-image {
    object-position: center;
    object-fit: cover;
    transition: opacity 0.3s ease;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure image container takes full width */
.aspect-video, .aspect-\[4\/3\] {
    width: 100% !important;
}

/* Image gallery container */
.aspect-video.lg\:aspect-\[4\/3\] {
    background-color: #f3f4f6;
}

/* Primary Button Styles */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* Link Colors */
.text-primary-blue {
    color: var(--primary-blue);
}

.text-primary-blue:hover {
    color: var(--primary-blue-dark);
}

/* Border Colors */
.border-primary-blue {
    border-color: var(--primary-blue);
}

/* Background Colors */
.bg-primary-blue {
    background-color: var(--primary-blue);
}

.bg-fresh-blue {
    background-color: var(--primary-blue);
}

/* Product Card Styles */
.product-card-price {
    color: #1f2937; /* gray-800 - dark navy for readability */
    font-weight: 700;
}

.product-card-title {
    color: #374151; /* gray-700 - slightly lighter navy */
    font-weight: 600; /* semibold weight for better highlight */
    /* Removed nowrap, ellipsis, and max-width to allow 2-line wrapping */
}

/* Enhanced line clamp for property cards with higher specificity */
.product-card-title.line-clamp-2 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    text-overflow: unset !important;
    max-width: unset !important;
}

.product-card-specs {
    color: #6b7280; /* gray-500 - muted for secondary info */
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
  @media (max-width: 768px) {
    .hero-slider {
        height: 30vh;
        min-height: 200px;
        max-height: 250px;
    }
}kit-box-orient: vertical;
    overflow: hidden;
}

/* Equal Height Cards */
.equal-height-grid {
    display: grid;
    grid-template-rows: 1fr;
}

.equal-height-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content > *:last-child {
    margin-top: auto;
}

/* Improved Mobile Grid */
@media (max-width: 640px) {
    .mobile-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.75rem;
    }
    
    .mobile-card-spacing {
        padding: 0.75rem;
    }
    
    .mobile-text-sm {
        font-size: 0.8rem;
    }
}

/* Adaptive Responsive Grid - Prioritizes Readability */
.product-grid {
    display: grid;
    gap: 0.75rem;
    /* Use auto-fit with intelligent minimum width based on content needs */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* Small mobile devices - prioritize single column for readability */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Medium mobile devices - allow 2 columns if screen is wide enough */
@media (min-width: 481px) and (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.875rem;
    }
}

/* Large mobile/small tablet - ensure good spacing */
@media (min-width: 641px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Transitions - Faster */
* {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Animations - Faster */
.card-enter {
    opacity: 0;
    transform: translateY(15px);
    animation: cardEnter 0.3s ease-out forwards;
}

@keyframes cardEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Animation - Faster */
.card-enter:nth-child(1) { animation-delay: 0.05s; }
.card-enter:nth-child(2) { animation-delay: 0.1s; }
.card-enter:nth-child(3) { animation-delay: 0.15s; }
.card-enter:nth-child(4) { animation-delay: 0.2s; }
.card-enter:nth-child(5) { animation-delay: 0.25s; }

/* Card Image Consistency */
.card-image {
    aspect-ratio: 4/3;
    object-fit: cover;
}

@media (max-width: 640px) {
    .card-image {
        aspect-ratio: 3/2;
    }
}

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Price animation */
@keyframes priceHighlight {
    0% { color: inherit; }
    50% { color: #FF6B35; }
    100% { color: inherit; }
}

.price-highlight {
    animation: priceHighlight 2s ease-in-out;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(45deg, #2C5F7C, #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2C5F7C;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a4456;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .container-mobile {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .text-mobile-sm {
        font-size: 0.75rem;
    }
    
    .button-mobile {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Loading skeleton */
.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; }
}

/* Sticky header enhancement */
.header-blur {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Card hover effects */
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Badge animations */
.badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* WhatsApp button enhancement */
.whatsapp-btn:hover {
    background-color: #25D366;
    transform: scale(1.02);
}

/* Search input focus effect */
.search-focus:focus {
    box-shadow: 0 0 0 3px rgba(44, 95, 124, 0.1);
    border-color: #2C5F7C;
}

/* Filter dropdown enhancements */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23666666' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 36px !important;
}

/* Specific styling for filter selects */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23666666' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

select:focus {
    outline: none;
    ring: 2px;
    ring-color: #2C5F7C;
    border-color: #2C5F7C;
}

/* Infinite scroll loading indicator */
.loading-indicator {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner-large {
    border: 4px solid rgba(45, 95, 124, 0.2);
    border-top: 4px solid #2C5F7C;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2C5F7C;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced loading states and smooth transitions */
.loading {
    opacity: 0.6;
    pointer-events: none;
    filter: blur(1px);
}

.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Enhanced button transitions */
button, select, input {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover, select:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active, select:active {
    transform: translateY(0);
}

/* Smooth focus states */
input:focus, select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(44, 95, 124, 0.1);
}

/* Card micro-interactions */
.product-grid > div {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-grid > div:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Image loading animation */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

img[src] {
    opacity: 1;
}

/* Filter feedback animation */
.filter-active {
    background: linear-gradient(45deg, #2C5F7C, #FF6B35) !important;
    color: white !important;
    transform: scale(1.05);
}

/* Hero Slider Styles */
.hero-slider {
    position: relative;
    height: 35vh;
    min-height: 240px;
    max-height: 300px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-prev, .hero-next {
    z-index: 10;
    backdrop-filter: blur(4px);
}

.hero-indicators {
    z-index: 10;
}

/* Hero Slider Navigation Buttons */
#hero-prev, #hero-next {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#hero-prev:hover, #hero-next:hover {
    backdrop-filter: blur(12px);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Hero Slider Indicators */
.hero-indicator {
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.hero-indicator.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

@media (max-width: 640px) {
    .hero-slider {
        height: 50vh;
        min-height: 300px;
    }
}

/* Action Button Styles */
.action-btn {
    @apply inline-flex items-center justify-center w-8 h-8 rounded-md text-white transition-all duration-200 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-1;
}

.action-btn-edit {
    @apply bg-blue-500 hover:bg-blue-600 focus:ring-blue-500;
}

.action-btn-success {
    @apply bg-green-500 hover:bg-green-600 focus:ring-green-500;
}

.action-btn-warning {
    @apply bg-yellow-500 hover:bg-yellow-600 focus:ring-yellow-500;
}

.action-btn-danger {
    @apply bg-red-500 hover:bg-red-600 focus:ring-red-500;
}

.action-btn-delete {
    @apply bg-red-500 hover:bg-red-600 focus:ring-red-500;
}

.action-btn i {
    @apply text-xs;
}
