/**
 * Cosmic Properties Browser
 * Full-screen property browsing interface with falling stars
 */

.cosmic-properties-browser {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999997;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.cosmic-properties-browser.active {
    display: block;
    opacity: 1;
}

.properties-browser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

/* Falling Stars Animation */
.falling-stars-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.falling-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
    opacity: 0;
    animation: starFall 3s linear infinite;
}

.falling-star:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.falling-star:nth-child(2) {
    left: 30%;
    animation-delay: 1s;
    animation-duration: 3.5s;
}

.falling-star:nth-child(3) {
    left: 50%;
    animation-delay: 2s;
    animation-duration: 4s;
}

.falling-star:nth-child(4) {
    left: 70%;
    animation-delay: 0.5s;
    animation-duration: 3.2s;
}

.falling-star:nth-child(5) {
    left: 85%;
    animation-delay: 1.5s;
    animation-duration: 3.8s;
}

@keyframes starFall {
    0% {
        top: -10%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

.properties-browser-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
.properties-browser-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.properties-browser-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.properties-browser-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

/* Menu Icon Buttons - Bigger & Better Organized */
.browser-menu-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
}

.browser-menu-btn {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #8b9dff;
    font-size: 24px;
    position: relative;
}

.browser-menu-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, sans-serif;
}

.browser-menu-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    border-color: rgba(102, 126, 234, 0.7);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: #a5b4ff;
}

.browser-menu-btn:hover::after {
    opacity: 1;
}

.browser-menu-btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.browser-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.browser-close-btn svg {
    color: #fff;
}

.browser-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Filters - Better Organized */
.properties-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filter-select {
    padding: 14px 18px;
    background: rgba(102, 126, 234, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.filter-select:hover,
.filter-select:focus {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.6);
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 10px;
}

.filter-reset-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.25));
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 10px;
    color: #ff6b6b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-reset-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(220, 38, 38, 0.35));
    border-color: rgba(239, 68, 68, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    color: #ff8787;
}

/* Properties Grid */
.properties-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
    align-content: start;
}

/* Loading State */
.properties-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Property Card */
.property-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
}

.property-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-image svg {
    opacity: 0.5;
}

.tier-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: rgba(255, 215, 0, 0.9);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-available {
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
}

.status-sold {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.status-resale {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
}

.status-reserved {
    background: rgba(251, 146, 60, 0.9);
    color: #fff;
}

.property-info {
    padding: 20px;
}

.property-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.property-location svg {
    flex-shrink: 0;
}

.property-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.property-price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.property-size {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* No Results */
.properties-no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.properties-no-results svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.properties-no-results h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.properties-no-results p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

/* Error State */
.properties-error {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.properties-error svg {
    margin-bottom: 20px;
    color: #ef4444;
}

.properties-error h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.properties-error p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.properties-error button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.properties-error button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Scrollbar */
.properties-grid::-webkit-scrollbar {
    width: 8px;
}

.properties-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.properties-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.properties-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .properties-browser-container {
        padding: 15px;
    }

    .properties-browser-header h1 {
        font-size: 24px;
    }

    .properties-browser-header p {
        font-size: 14px;
    }

    .browser-menu-icons {
        gap: 10px;
        padding: 12px 15px;
        margin-top: 15px;
    }

    .browser-menu-btn {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .browser-menu-btn::after {
        font-size: 9px;
        bottom: -20px;
    }

    .properties-filters {
        flex-direction: column;
        padding: 15px;
    }

    .filter-select {
        min-width: 100%;
    }

    .properties-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .property-card {
        border-radius: 12px;
    }

    .property-image {
        height: 160px;
    }

    .property-name {
        font-size: 16px;
    }

    .property-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .properties-browser-header h1 {
        font-size: 20px;
    }

    .browser-close-btn {
        width: 36px;
        height: 36px;
    }

    .browser-menu-icons {
        gap: 8px;
        padding: 10px 12px;
        margin-top: 12px;
    }

    .browser-menu-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }

    .browser-menu-btn::after {
        font-size: 8px;
        bottom: -18px;
    }

    .property-info {
        padding: 15px;
    }

    .property-name {
        font-size: 15px;
    }

    .property-price {
        font-size: 16px;
    }
}
