/* Hublyst - Modern Sublease Platform */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #ececf0;
    --secondary-foreground: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #d4183d;
    --dark: #1e293b;
    --light: #ffffff;
    --gray-100: #f3f3f5;
    --gray-200: #ececf0;
    --gray-300: #cbced4;
    --gray-400: #9ca3af;
    --gray-500: #717182;
    --gray-600: #4b5563;
    --muted: #ececf0;
    --muted-foreground: #717182;
    --accent: #e9ebef;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #f3f3f5;
    --radius: 0.625rem;
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.07);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    font-weight: 400;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    line-height: 1;
}

.nav-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab:hover {
    background: var(--accent);
    color: var(--dark);
    text-decoration: none;
}

.nav-tab.is-active {
    background: var(--accent);
    color: var(--dark);
}

.nav-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-cta {
    border-radius: 10px;
}

.nav-more {
    position: relative;
}

.nav-more-trigger {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.875rem;
    background: var(--accent);
}

.nav-more-trigger::-webkit-details-marker {
    display: none;
}

.nav-more[open] .nav-more-trigger {
    background: var(--gray-200);
    color: var(--dark);
}

.nav-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 220px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 200;
}

.nav-more-menu a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: var(--gray-600);
    font-weight: 600;
    text-decoration: none;
}

.nav-more-menu a:hover {
    background: var(--gray-100);
    color: var(--dark);
    text-decoration: none;
}

.nav-more-sep {
    height: 1px;
    background: var(--gray-200);
    margin: 0.35rem 0.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--gray-600);
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 900px) {
    .navbar-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-tabs {
        position: static;
        transform: none;
        order: 3;
        flex: 1 1 100%;
        justify-content: flex-start;
        margin: 0;
        padding-bottom: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    opacity: 0.9;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background: var(--gray-300);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dark);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--dark);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
}

/* Hero */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("/static/images/boston-hero.acd70dbd0acc.jpg") center/cover no-repeat;
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-weight: 400;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

.hero-search input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-size: 1rem;
    outline: none;
    border-radius: var(--radius);
}

.hero-search .btn {
    padding: 1rem 2rem;
}

/* Section */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.025em;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Listing Card */
.listing-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.listing-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-200);
}

.listing-card-content {
    padding: 1.25rem;
}

.listing-card-price {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary);
}

.listing-card-price span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--gray-500);
}

.listing-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0.5rem 0;
    color: var(--dark);
}

.listing-card-location {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.listing-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--input-bg);
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dark);
    background: white;
}

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

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Filters */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filters-row .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* Detail Page */
.detail-header {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.carousel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s;
}

.carousel-btn:hover {
    background: white;
}

.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }

.carousel-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: white;
}

.detail-sidebar {
    position: sticky;
    top: 100px;
}

.price-box {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.price-box .price {
    font-size: 2rem;
    font-weight: 500;
    color: var(--primary);
}

.price-box .price span {
    font-size: 1rem;
    color: var(--gray-500);
}

/* Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Inbox */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
    transition: background 0.2s;
}

.thread-item:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.thread-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.thread-info {
    flex: 1;
}

.thread-name {
    font-weight: 600;
}

.thread-preview {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Chat */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
    max-height: 500px;
    overflow-y: auto;
}

.message {
    max-width: 70%;
    padding: 1rem;
    border-radius: var(--radius);
}

.message-sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-received {
    background: var(--gray-200);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chat-input input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--muted);
    color: var(--muted-foreground);
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer a {
    color: var(--gray-400);
}

.footer-disclaimer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    border-top: 1px solid var(--gray-700);
    margin-top: 1.5rem;
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    /* Navbar */
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        font-size: 0.875rem;
    }
    
    .nav-links a {
        padding: 0.5rem;
    }
    
    /* Hero */
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-search {
        flex-direction: column;
    }
    
    /* Sections */
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Cards */
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .listing-card-image {
        height: 180px;
    }
    
    /* Detail page */
    .detail-header {
        grid-template-columns: 1fr;
    }
    
    .carousel-track {
        height: 280px;
    }
    
    .detail-sidebar {
        position: static;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters {
        padding: 1rem;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filters-row .form-group {
        min-width: 100%;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .btn-sm {
        width: auto;
    }
    
    /* Chat */
    .message {
        max-width: 85%;
    }
    
    .chat-messages {
        max-height: 400px;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Price box */
    .price-box .price {
        font-size: 1.5rem;
    }
    
    /* Tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .nav-links {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .listing-card-content {
        padding: 1rem;
    }
    
    .listing-card-price {
        font-size: 1.25rem;
    }
    
    .listing-card-title {
        font-size: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
}
