/* Premium Real Estate Website Styles - Black + Gold + White Theme */
:root {
    --black: #000000;
    --dark-gray: #1a1a1a;
    --gold: #d4af37;
    --light-gold: #f6e05e;
    --white: #ffffff;
    --royal-blue: #4169e1;
    --emerald-green: #50c878;
    --success-color: #38a169;
    --warning-color: #ecc94b;
    --danger-color: #e53e3e;
    --light-color: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    --gradient-gold: linear-gradient(135deg, var(--gold) 0%, var(--light-gold) 100%);
    --gradient-royal: linear-gradient(135deg, var(--royal-blue) 0%, #5b7fdb 100%);
    --gradient-emerald: linear-gradient(135deg, var(--emerald-green) 0%, #6edb9b 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--dark-gray);
    background: var(--white);
    overflow-x: hidden;
}

/* Premium Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white) !important;
}

.navbar-brand img {
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: var(--gold) !important;
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-1px);
}

/* Premium Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(26, 26, 26, 0.9)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><rect fill="%23000000" width="1200" height="800"/><path fill="%231a1a1a" fill-opacity="0.1" d="M0,0L1200,800L0,800Z"/></svg>') center/cover;
    color: var(--white);
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle fill="%23d4af37" fill-opacity="0.1" cx="50" cy="50" r="2"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section p.lead {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: #ffffff;
    opacity: 1;
    font-weight: 400;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

/* Premium Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 1rem 2rem;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--black) !important;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--light-gold) 0%, var(--gold) 100%);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
    transform: translateY(-3px);
}

/* Premium Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    background: var(--white);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-title {
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--dark-gray);
    opacity: 0.8;
}

/* Premium Project Cards */
.project-card {
    position: relative;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    background: var(--white);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.project-status {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
}

.project-image {
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image {
    transform: scale(1.08);
}

/* Premium Statistics */
.stat-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Premium Testimonials */
.testimonial-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-color) 100%);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: var(--transition);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.1;
    font-family: Georgia, serif;
}

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

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--dark-gray);
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

.testimonial-author {
    font-weight: 700;
    color: var(--black);
    font-size: 1.1rem;
}

/* Premium Sections */
section {
    padding: 5rem 0;
}

section.bg-light {
    background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%) !important;
}

section.bg-primary {
    background: var(--gradient-primary) !important;
}

/* Premium Typography */
.display-4 {
    font-weight: 800;
    color: var(--black);
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--dark-gray);
    opacity: 0.9;
}

/* Premium Badges */
.badge {
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge.bg-info {
    background: var(--gradient-gold) !important;
    color: var(--black) !important;
}

/* Premium Animations */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

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

/* Premium Glassmorphism */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
}

/* Premium Footer */
footer {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3rem 0 2rem;
}

@media (max-width: 768px) {
    footer {
        padding: 2rem 0 1.5rem;
        text-align: center;
    }

    footer .row {
        justify-content: center;
    }

    footer .text-md-end {
        text-align: center !important;
    }

    footer h5 {
        margin-top: 1rem;
    }

    footer .social-links {
        justify-content: center;
    }
}

footer h5 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gold);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--gold);
    transform: translateX(5px);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--gold);
    transform: translateY(-3px);
}

/* Premium Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p.lead {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
    }

    /* Sidebar adjustments for mobile */
    .sidebar {
        overflow-y: auto; /* Allow scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        background-color: var(--black); /* Ensure background color */
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 100px 0 80px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Dashboard Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Dashboard statistics cards */
    .col-md-3.col-6.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .card.text-center .card-body {
        padding: 1rem;
    }
    
    .card.text-center .fa-3x {
        font-size: 2rem;
    }
    
    .card.text-center .h2 {
        font-size: 1.5rem;
    }
    
    /* Subscription journey module */
    .card-body .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    /* Earnings chart */
    #earningsChart {
        max-width: 100%;
        height: auto !important;
    }
    
    .btn-group.btn-group-sm.float-end {
        float: none !important;
        margin-top: 0.5rem;
        justify-content: center;
    }
    
    /* Referral network table */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Quick actions buttons */
    .d-grid.gap-2 .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Recent commissions list */
    .list-group-item .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .list-group-item .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Statistics cards - stack vertically */
    .col-md-3.col-6.mb-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Main content columns */
    .col-lg-6.col-md-8.mb-4,
    .col-lg-4.col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Card headers */
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    /* Progress bars */
    .progress {
        height: 15px !important;
    }
    
    /* Buttons in cards */
    .card-body .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    /* Modal adjustments */
    .modal-dialog.modal-lg {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Team hierarchy in modal */
    .team-level {
        flex-direction: column;
        align-items: center;
    }
    
    .member-card {
        min-width: auto;
        width: 100%;
        max-width: 280px;
    }
}

/* Extra small devices (phones, 320px and up) */
@media (max-width: 375px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Ensure charts are responsive */
#earningsChartContainer {
    max-width: 100%;
    width: 100%;
}

#earningsChart {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Improve touch targets for mobile */
.btn, 
.nav-link,
.form-control {
    min-height: 44px;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Improve readability on small screens */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

/* Premium Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Premium Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-md);
}

.alert-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #48bb78 100%);
    color: var(--white);
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f56565 100%);
    color: var(--white);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--light-gold) 100%);
    color: var(--black);
}

.alert-info {
    background: linear-gradient(135deg, var(--royal-blue) 0%, #63b3ed 100%);
    color: var(--white);
}

/* Premium Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table th {
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 600;
    border: none;
    padding: 1.25rem;
}

.table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-color: rgba(212, 175, 55, 0.1);
}

/* Premium Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--gradient-primary);
    color: var(--white);
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    font-weight: 700;
}

/* Custom Utilities */
.text-primary {
    color: var(--black) !important;
}

.bg-primary {
    background: var(--gradient-primary) !important;
}

.text-accent {
    color: var(--gold) !important;
}

.bg-accent {
    background: var(--gradient-gold) !important;
}

/* Premium Hover Effects */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-3px);
}

.hover-scale {
    transition: var(--transition);
}

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

/* Premium Gradient Text */
.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== User area: main content & responsive ========== */
.main-content-area {
    padding-top: 80px;
    min-height: calc(100vh - 160px);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* User: Navbar responsive */
.navbar .container {
    max-width: 100%;
}

.navbar-brand {
    font-size: 1.15rem;
    max-width: 60%;
}

.navbar-brand img {
    height: 32px;
}

.navbar-toggler {
    padding: 0.5rem 0.75rem;
    min-width: 44px;
    min-height: 44px;
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.35);
}

.navbar-collapse {
    margin-top: 0.5rem;
}

.navbar-nav .nav-link {
    padding: 0.6rem 0.75rem;
}

.dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
}

/* User: Responsive breakpoints */
@media (max-width: 991px) {
    .main-content-area {
        padding-top: 72px;
        min-height: calc(100vh - 140px);
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }

    section.py-4,
    section.bg-light {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content-area {
        padding-top: 68px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .hero-section {
        padding: 80px 0 60px;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    /* Dashboard stat cards: 2 per row on small phones */
    .col-md-2.col-6.mb-4 .card-body {
        padding: 0.75rem 0.5rem;
    }

    .col-md-2.col-6.mb-4 .fa-3x {
        font-size: 1.75rem;
    }

    .col-md-2.col-6.mb-4 .card-title.h2 {
        font-size: 1.1rem;
    }

    .col-md-2.col-6.mb-4 .card-text {
        font-size: 0.75rem;
    }

    .table-responsive {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-fullscreen-sm-down {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }
}

@media (max-width: 576px) {
    .main-content-area {
        padding-top: 64px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .navbar-brand {
        font-size: 1rem;
        max-width: 55%;
    }

    .navbar-brand img {
        height: 28px;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .alert {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 375px) {
    .col-md-2.col-6.mb-4 .card-title.h2 {
        font-size: 1rem;
    }
}

/* Touch: ensure tap targets */
@media (hover: none) and (pointer: coarse) {
    .main-content-area .btn,
    .main-content-area .nav-link,
    .navbar .nav-link,
    .navbar .dropdown-toggle {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar .dropdown-menu .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
}
