/* ============================================
   SARA UYLAR THEME - HAVORANG RANGLAR
   ============================================ */

:root {
    /* Havorang ranglar - To'q ko'k/moviy */
    --youtube-red: #1E88E5;
    --youtube-red-dark: #1565C0;
    --youtube-red-light: #42A5F5;
    
    /* Fon ranglar */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9F9F9;
    --bg-dark: #181818;
    --bg-dark-secondary: #212121;
    --bg-hover: #F2F2F2;
    
    /* Matn ranglar */
    --text-primary: #030303;
    --text-secondary: #606060;
    --text-white: #FFFFFF;
    
    /* Border va divider */
    --border-color: #E5E5E5;
    --divider-color: #E5E5E5;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    
    /* Transition */
    --transition: all 0.2s ease;
}

/* Dark mode */
body.dark-mode {
    --bg-primary: #181818;
    --bg-secondary: #212121;
    --bg-hover: #2D2D2D;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --border-color: #303030;
    --divider-color: #303030;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #030303;
    line-height: 1.6;
    transition: var(--transition);
}

[data-theme="dark"] body {
    background-color: #0F0F0F;
    color: #F1F1F1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HEADER - YouTube Style
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E5E5;
    z-index: 1000;
    transition: var(--transition);
}

[data-theme="dark"] .header {
    background: #1C1C1C;
    border-bottom-color: #303030;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.logo:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .logo {
    color: #F1F1F1;
}

[data-theme="dark"] .logo:hover {
    background: rgba(255,255,255,0.1);
}

.logo i {
    color: #1E88E5;
    font-size: 28px;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: 0 16px;
    height: 40px;
    transition: var(--transition);
}

.header-search:focus-within {
    border-color: #1E88E5;
    background: var(--bg-primary);
}

.header-search i {
    color: var(--text-secondary);
    margin-right: 12px;
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
}

.header-search input::placeholder {
    color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .btn-icon {
    color: #F1F1F1;
}

[data-theme="dark"] .btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

.btn-icon i {
    font-size: 24px;
}

/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--youtube-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-top: 56px;
    padding: 24px 16px;
    min-height: calc(100vh - 56px);
}

.container {
    max-width: 1920px;
    margin: 0 auto;
}

/* ============================================
   CATEGORY TABS - YouTube Style
   ============================================ */

.category-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 0;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F9F9F9;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: #030303;
    transition: var(--transition);
}

.category-tab:hover {
    background: #F2F2F2;
}

[data-theme="dark"] .category-tab {
    background: #212121;
    border-color: #303030;
    color: #F1F1F1;
}

[data-theme="dark"] .category-tab:hover {
    background: #3F3F3F;
}

.category-tab.active {
    background: #1E88E5;
    color: white;
    border-color: #1E88E5;
}

.category-tab i {
    font-size: 20px;
}

/* ============================================
   PROPERTIES GRID - YouTube Video Grid Style
   ============================================ */

.properties-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #030303;
}

[data-theme="dark"] .section-header h2 {
    color: #F1F1F1;
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.sort-options select:hover {
    background: var(--bg-hover);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Property Card - YouTube Video Card Style */
.property-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.property-card:hover {
    transform: translateY(-2px);
}

.property-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: var(--bg-secondary);
}

.property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.property-card:hover .property-image img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #1E88E5;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.property-price {
    font-size: 20px;
    font-weight: 700;
    color: #1E88E5;
    margin-top: 8px;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.favorite-btn.active i {
    color: #E53935;
}

.property-info {
    padding: 12px;
}

.property-title {
    font-size: 16px;
    font-weight: 500;
    color: #030303;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="dark"] .property-title {
    color: #F1F1F1;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #606060;
    font-size: 14px;
    margin-bottom: 8px;
}

[data-theme="dark"] .property-location {
    color: #AAAAAA;
}

.property-location i {
    font-size: 16px;
}

.property-specs {
    display: flex;
    gap: 16px;
    color: #606060;
    font-size: 14px;
}

[data-theme="dark"] .property-specs {
    color: #AAAAAA;
}

.property-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-specs i {
    font-size: 16px;
}

/* ============================================
   BUTTONS - YouTube Style
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 18px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #1E88E5;
    color: white;
}

.btn-primary:hover {
    background: #1565C0;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-outline {
    background: transparent;
    color: #1E88E5;
    border: 2px solid #1E88E5;
}

.btn-outline:hover {
    background: var(--youtube-red);
    color: white;
}

.btn i {
    font-size: 20px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 56px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 999;
}

.sidebar.active {
    left: 0;
}

.sidebar-menu {
    padding: 12px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-item:hover {
    background: var(--bg-hover);
}

.sidebar-item.active {
    background: var(--bg-hover);
    border-left: 3px solid var(--youtube-red);
}

.sidebar-item i {
    font-size: 24px;
    color: var(--text-primary);
}

.sidebar-item.active i {
    color: var(--youtube-red);
}

.sidebar-divider {
    height: 1px;
    background: var(--divider-color);
    margin: 12px 0;
}

/* ============================================
   SEARCH PANEL - YouTube Full Screen Style
   ============================================ */

.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1001;
    transform: translateY(-100%);
    opacity: 0;
}

.search-panel.active {
    transform: translateY(0);
    opacity: 1;
}

.search-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-header .header-search {
    flex: 1;
    max-width: 600px;
    margin: 0;
}

.search-header h3 {
    font-size: 20px;
    font-weight: 700;
    display: none;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--youtube-red);
    background: var(--bg-primary);
}

.price-range,
.area-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range input,
.area-range input {
    flex: 1;
}

/* ============================================
   LOAD MORE
   ============================================ */

.load-more {
    text-align: center;
    margin-top: 32px;
}

/* ============================================
   OVERLAY
   ============================================ */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    transition: var(--transition);
}

.overlay.active {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .search-panel {
        width: 100%;
        right: -100%;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
}

@media (max-width: 480px) {
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .category-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
}


/* ============================================
   ANIMATIONS
   ============================================ */

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

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

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--youtube-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading span {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-hover) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

.skeleton-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.skeleton-image {
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-secondary);
}

.skeleton-text {
    height: 16px;
    margin: 12px;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.skeleton-text.short {
    width: 60%;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--youtube-red);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    background: var(--youtube-red-dark);
}

.scroll-to-top i {
    font-size: 24px;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.property-card {
    transition: all 0.2s ease;
}

.property-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   FOCUS STATES
   ============================================ */

.btn:focus,
.btn-icon:focus,
.form-control:focus {
    outline: 2px solid var(--youtube-red);
    outline-offset: 2px;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .scroll-to-top i {
        font-size: 20px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .header,
    .sidebar,
    .search-panel,
    .overlay,
    .scroll-to-top,
    .btn,
    .favorite-btn {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .property-card {
        break-inside: avoid;
    }
}


/* ============================================
   DARK MODE - YOUTUBE STYLE
   ============================================ */

[data-theme="dark"] {
    --bg-primary: #0F0F0F;
    --bg-secondary: #212121;
    --bg-hover: #3F3F3F;
    --text-primary: #F1F1F1;
    --text-secondary: #AAAAAA;
    --border-color: #303030;
    --divider-color: #303030;
}

[data-theme="dark"] .header {
    background: #0F0F0F;
    border-bottom-color: #303030;
}

[data-theme="dark"] .sidebar {
    background: #0F0F0F;
    border-right-color: #303030;
}

[data-theme="dark"] .search-panel {
    background: #0F0F0F;
    border-left-color: #303030;
}

[data-theme="dark"] .property-card {
    background: #0F0F0F;
}

[data-theme="dark"] .property-card:hover {
    background: #1A1A1A;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .category-tab {
    background: #212121;
    border-color: #303030;
    color: #F1F1F1;
}

[data-theme="dark"] .category-tab:hover {
    background: #3F3F3F;
}

[data-theme="dark"] .category-tab.active {
    background: #1E88E5;
    color: white;
    border-color: #1E88E5;
}

[data-theme="dark"] .form-control {
    background: #212121;
    border-color: #303030;
    color: #F1F1F1;
}

[data-theme="dark"] .form-control:focus {
    background: #0F0F0F;
    border-color: #1E88E5;
}

[data-theme="dark"] .btn-secondary {
    background: #212121;
    border-color: #303030;
    color: #F1F1F1;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #3F3F3F;
}

[data-theme="dark"] .modal-content {
    background: #212121;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #303030;
}

[data-theme="dark"] .auth-card {
    background: #212121;
}

[data-theme="dark"] .profile-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .owner-info,
[data-theme="dark"] .property-description {
    background: #212121;
}

[data-theme="dark"] .card {
    background: #0F0F0F;
}

[data-theme="dark"] .empty-state i {
    color: #606060;
}

[data-theme="dark"] .loading {
    color: #AAAAAA;
}

[data-theme="dark"] .spinner {
    border-color: #303030;
    border-top-color: #1E88E5;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        #212121 25%,
        #3F3F3F 50%,
        #212121 75%
    );
    background-size: 200% 100%;
}

[data-theme="dark"] .favorite-btn {
    background: rgba(33, 33, 33, 0.9);
}

[data-theme="dark"] .favorite-btn:hover {
    background: rgba(33, 33, 33, 1);
}

/* Dark mode transitions */
body,
.header,
.sidebar,
.search-panel,
.property-card,
.category-tab,
.form-control,
.btn-secondary,
.modal-content,
.card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* ============================================
   SEARCH PANEL FORM
   ============================================ */

.search-panel .search-form {
    margin-top: 24px;
}

.search-panel .form-group {
    margin-bottom: 24px;
}

.search-panel .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.search-panel .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Search Panel Header Search Input */
.search-panel .header-search {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.search-panel .header-search:focus-within {
    border-color: #1E88E5;
    background: var(--bg-primary);
}

.search-panel .header-search input {
    font-size: 16px;
}

/* Search Form Enhancements */
.search-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form .form-group label i {
    font-size: 20px;
    color: #1E88E5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.quick-prices {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.quick-price-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-price-btn:hover {
    background: var(--bg-hover);
    border-color: #1E88E5;
}

.quick-price-btn.active {
    background: #1E88E5;
    color: white;
    border-color: #1E88E5;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn {
    flex: 1;
}

/* Mobile Search Panel */
@media (max-width: 768px) {
    .search-content {
        padding: 16px;
    }
    
    .search-header {
        padding: 12px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-prices {
        gap: 6px;
    }
    
    .quick-price-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}
