/* ==================== Variables ==================== */
:root {
    --primary-color: #d4af37;
    --dark-bg: #000;
    --card-bg: #1a1a1a;
    --border-color: #333;
    --text-primary: #fff;
    --text-secondary: #bbb;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ==================== App Container ==================== */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--dark-bg);
}

/* ==================== Header ==================== */
.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== Loading ==================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

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

.hidden {
    display: none !important;
}

/* ==================== Search & Filters ==================== */
.filters-panel {
    margin-bottom: 30px;
    position: relative;
}

.search-box {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.filters-toggle {
    width: 100%;
    padding: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.filters-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filters-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 5px;
    padding: 20px;
    z-index: 100;
    max-height: 500px;
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.filter-section h3 {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.filter-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-option.active {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border-color: var(--primary-color);
}

.price-inputs {
    display: flex;
    gap: 10px;
}

.price-input {
    flex: 1;
    padding: 10px;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

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

/* ==================== Featured Section ==================== */
.featured-section {
    margin-bottom: 40px;
}

.featured-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.featured-carousel {
    display: grid;
    grid-template-columns: repeat(auto-scroll, minmax(250px, 1fr));
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* ==================== Projects Section ==================== */
.projects-section {
    margin-bottom: 40px;
}

.projects-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ==================== Project Card ==================== */
.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.project-card-image {
    width: 100%;
    height: 180px;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-secondary);
}

.project-card-content {
    padding: 15px;
}

.project-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

.project-card-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.project-card-type {
    font-size: 12px;
    background-color: var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary-color);
}

.project-card-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--warning);
}

.project-card-status.ready {
    color: var(--success);
}

.project-card-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.project-card-views {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== Buttons ==================== */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: #e8c547;
    transform: scale(1.05);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== No Results ==================== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-results p {
    margin-bottom: 10px;
}

.text-small {
    font-size: 14px;
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: flex-end;
    z-index: 500;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-content {
    background-color: var(--card-bg);
    border-top: 2px solid var(--primary-color);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.modal-form {
    max-width: 500px;
}

/* ==================== Project Detail ==================== */
.project-detail {
    margin-bottom: 20px;
}

.project-detail h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.project-detail-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.project-detail-section:last-child {
    border-bottom: none;
}

.project-detail-section h3 {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.detail-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.detail-info-item {
    color: var(--text-secondary);
}

.detail-info-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.units-list {
    display: grid;
    gap: 10px;
}

.unit-item {
    background-color: var(--dark-bg);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.unit-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.unit-specs {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.unit-price {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ==================== Form ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* ==================== Notification ==================== */
.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification.error {
    background-color: var(--error);
    color: white;
}

.notification.success {
    background-color: var(--success);
    color: white;
}
