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

:root {
    /* Color palette - Orange/Yellow theme */
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fed7aa;
    --secondary: #fbbf24;
    --secondary-dark: #f59e0b;
    --secondary-light: #fef3c7;
    --accent: #fb923c;
    
    /* Status colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Neutral colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-light: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: var(--gray-800);
    line-height: 1.6;
    height: 100vh;
    width: 100vw;
}

header {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-xl);
    padding: var(--space-2) var(--space-6);
    position: fixed;
    top: 0;
    width: 100%;
    height: 13%;
    z-index: 1100;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 70%;
}

.header-title h1 {
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 4px solid var(--secondary);
}

/* Sidebar */

.sidebar {
    position: fixed;
    top: 13%;
    width: 25%;
    color: white;
    box-shadow: 8px 0 24px -4px rgb(0 0 0 / 0.15);
    height: 83%;
    overflow-y: scroll;
    overflow-x: hidden;
}

.sidebar-section-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: var(--space-4);
    color: var(--gray-800);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-map-container {
    height: 300px;
    margin-bottom: var(--space-2);
}

.sidebar-map {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.sidebar-overview {
    padding: var(--space-4);
    width: 100%;
    color: black;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.overview-item {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    text-decoration: none;
    line-height: normal;
}

/* Main */
.main {
    width: 75%;
    height: 83%;
    position: fixed;
    right: 0;
    top: 13%;
    overflow-y: scroll;
    padding: var(--space-4) var(--space-6);
}

/* Content Sections */
.content-section {
    display: none;
    width: 100%;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-800);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.sort-select {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--secondary);
    border-radius: var(--radius);
    background: white;
    transition: all var(--transition-fast);
}

.sort-select:hover {
    border-color: var(--primary);
}

/* Cards and Grids */
.listings-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.listing-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-200);
    width: 100%;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-light);
    gap: 10px;
}

.status-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    text-wrap: nowrap;
}

.status-evaluating {
    background: #f0f9ff;
    color: #5b21b6;
}

.status-waiting_for_call {
    background: #fff7ed;
    color: #c2410c;
}

.status-to_contact {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-to_recontact {
    background: #e0f2fe;
    color: #0369a1;
}

.status-contacting {
    background: #ffeb9d;
    color: #92400e;
}

.status-apt {
    background: #d1fae5;
    color: #065f46;
}

.status-visited {
    background: #e0e7ff;
    color: #3730a3;
}

.status-ended {
    background: #f3f4f6;
    color: var(--gray-600);
}

.status-offline {
    background: #fef2f2;
    color: #b91c1c;
}

.status-text-color-evaluating {
    color: #5b21b6;
}

.status-text-color-to_contact {
    color: #1d4ed8;
}

.status-text-color-to_recontact {
    color: #0369a1;
}

.status-text-color-contacting {
    color: #92400e;
}

.status-text-color-apt {
    color: #065f46;
}

.status-text-color-visited {
    color: #3730a3;
}

.status-text-color-ended {
    color: var(--gray-600);
}

.status-text-color-offline {
    color: #b91c1c;
}

.listing-title {
    margin: var(--space-2) 0;
    line-height: normal;
}

.listing-title a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Modal de changement de statut */
.status-modal {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 1000;
    border: 1px solid #e5e7eb;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-modal.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.status-modal::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.status-modal::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #e5e7eb;
    z-index: -1;
}

.status-modal-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.status-option:hover {
    background: #f3f4f6;
}

.status-option .status-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.status-option-text {
    font-size: 0.8rem;
    color: #374151;
}

/* Overlay pour fermer la modal */
.status-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

/* Modal de rendez-vous */
.appointment-banner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    border-radius: 0;
}

.appointment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #10b981;
    margin-bottom: 16px;
}

.appointment-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #10b981;
    font-weight: 600;
}

.appointment-date .time {
    color: #6b7280;
    font-weight: 500;
    margin-left: 8px;
}

.appointment-details h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
}

.appointment-details p {
    margin: 4px 0;
    color: #6b7280;
}

.appointment-details .notes {
    font-style: italic;
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.status-modal-overlay.active {
    display: block;
}

.vote-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vote-btn {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: scale(1.1);
}

.vote-count {
    font-weight: 700;
    color: var(--gray-700);
    min-width: 30px;
    text-align: center;
}

.appointment-banner {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

.appointment-banner-txt {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.appointment-banner-notes {
    font-size: 0.7rem;
    color: var(--gray-900);
    margin-left: var(--space-4);
}

.appointment-banner-icone {
    font-size: 1.4rem;
}

.appointment-banner .btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.6rem;
    color: var(--error);
    border: 1px solid var(--error);

}

.appointment-banner.priority {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(249, 115, 22, 0);
    }
}

.card-content {
    padding: var(--space-2);
}

.card-media-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.card-title-images-side {
    width: 35%;
}

.card-content h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.image-gallery {
    position: relative;
}

.main-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-count {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.prev_btn, .next_btn {
    position: absolute;
    bottom: 50px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
}

.next_btn {
    right: 10px;
}

.prev_btn {
    left: 10px;
}

.card-address-map-side {
    width: 35%;
}

.location-marker {
    color: var(--secondary);
    font-size: 110%;
}

.address-marker {
    color: var(--primary);
    font-size: 110%;
} 

.card-comment-side {
    width: 27%;
}

.listing-details {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-600);
    font-size: 0.8rem;
}

.detail-item i {
    color: var(--primary);
}

.detail-item.price {
    color: var(--success);
    font-weight: 700;
}

.location {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    font-size: 0.8rem;
}

.location i {
    color: var(--primary);
}

.comments-preview {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.comment-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: 0.8rem;
    color: var(--gray-700);
}

.comment-item i {
    color: var(--secondary);
    margin-top: 2px;
}

.comment-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--space-2);
    text-align: right;
}

.card-actions {
    padding: var(--space-2);
    background: var(--gray-50);
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.card-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.7rem;
}

.travel-times-line, .description-line, .comments-line, .agency-contact-line {
    background-color: var(--gray-50);
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-4);
    margin-bottom: var(--space-2);
}

.phone-link {
    color: var(--primary);
    text-decoration: none;
}

.phone-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    border: 1px solid transparent;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--gray-700);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow);
}

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

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-lg);
}

.btn.full-width {
    width: 100%;
    justify-content: center;
}

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

.btn-share:hover {
    background: darken(var(--primary), 5%);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: var(--shadow);
}

.btn-warning:hover {
    background-color: var(--error);
    box-shadow: var(--shadow-lg);
}

/* Forms */
.listing-form {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group.half-width {
    grid-column: span 1;
}

.form-group.quarter-width {
    grid-column: span 1 / span 4;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-actions {
    grid-column: span 2;
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
    margin-top: var(--space-4);
}

/* Detail View */
.detail-view {
    flex-direction: column;
}

.detail-view .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 0;
}

.detail-header {
    background: white;
    padding: var(--space-6) var(--space-8);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.detail-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-800);
    flex: 1;
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-8);
    padding: var(--space-8);
    align-items: start;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    position: sticky;
    top: var(--space-8);
}

/* Images Gallery */
.images-gallery {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.main-image img {
    width: auto;
    height: auto;
    max-height: 130px;
    border-radius: var(--radius);
}

.thumbnails {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 2px;
}

.thumbnail {
    width: auto;
    height: 50px;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    box-sizing: border-box;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Property Details */
.property-details {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1);
    background: var(--gray-50);
    border-radius: var(--radius);
}

.detail-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.detail-item span:first-of-type {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.detail-item strong {
    color: var(--gray-800);
    font-weight: 700;
    margin-left: auto;
}

.online {
    color: var(--success);
    font-weight: 600;
}

.offline {
    color: var(--error);
    font-weight: 600;
}

/* Maps */
.map-container {
    width: 100%;
    height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.listing-map, .reference-map {
    height: 100%;
    width: 100%;
}

/* Section Styles */
.location-section,
.travel-times-section,
.description-section,
.contact-section,
.conditions-section,
.comments-section {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.location-section h3,
.travel-times-section h3,
.description-section h3,
.contact-section h3,
.conditions-section h3,
.comments-section h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
}

.location-text,
.address-text,
.description-text,
.contact-text,
.conditions-text {
    color: var(--gray-700);
    line-height: 1.6;
}

.description-text {
    font-size: 0.8rem;
}

/* Travel Times */
.travel-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.travel-time-card {
    padding: var(--space-1) var(--space-2);
    background: var(--gray-200);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.travel-time-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.destination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-700);
    font-weight: 600;
}

.destination i {
    color: var(--primary);
}

.time {
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.manual {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.travel-route-map {
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: var(--space-4);
    display: none;
}

/* Comments */
.add-comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.add-comment-form textarea {
    flex: 1;
    padding: var(--space-2);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 40px;
    font-size: small;
    resize: none;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    max-height: 150px;
    overflow-y: scroll;
}

.comment-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--gray-50);
    border-radius: var(--radius);
}

.comment-item i {
    color: var(--secondary);
    margin-top: 2px;
}

.no-comments {
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
    padding: var(--space-2);
}

/* Sidebar Cards */
.voting-card,
.actions-card,
.metadata-card {
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.voting-card h4,
.actions-card h4,
.metadata-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.vote-controls.large {
    justify-content: space-evenly;
    gap: var(--space-3);
    align-items: center;
}

.vote-controls.large .vote-btn {
    padding: var(--space-3);
    font-size: 1.25rem;
}

.vote-controls.large .vote-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.metadata-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.metadata-item span {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.metadata-item strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* Reference Addresses */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    width: 100%;
    overflow: hidden;
}

.address-card {
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
}

.small-address-card {
    background: white;
    padding: var(--space-3);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
    width: 100%;
    overflow: hidden;
}

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

.address-card-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-3);
    width: 100%;
}

.small-address-card .address-card-title {
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.address-card-title i {
    color: var(--primary);
}

.address-text {
    color: var(--gray-600);
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.small-address-card .address-text {
    margin: 0;
    width: 100%;
}

.address-actions {
    display: flex;
    gap: var(--space-2);
}

/* Appointments */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.appointment-card {
    background: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--space-5);
    transition: all var(--transition-normal);
}

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

.appointment-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4);
    background: var(--gradient-light);
    border-radius: var(--radius);
    min-width: 120px;
    text-align: center;
}

.appointment-date i {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
}

.appointment-details {
    flex: 1;
}

.appointment-details h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
}

.appointment-details p {
    color: var(--gray-600);
    margin-bottom: var(--space-1);
}

.appointment-details .notes {
    font-style: italic;
    color: var(--gray-500);
}

/* Calendar Styles */

.calendar-controls {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.calendar-controls span {
    font-weight: 600;
    color: var(--gray-800);
    min-width: 150px;
    text-align: center;
}

.calendar-container {
    background: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-2);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.calendar-header {
    background: var(--primary);
    color: white;
    padding: var(--space-2);
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.calendar-day {
    background: white;
    min-height: 60px;
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.calendar-day:hover {
    background: var(--gray-50);
}

.calendar-day.other-month {
    background: var(--gray-100);
    color: var(--gray-400);
}

.calendar-day.today {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

.calendar-day.has-appointment {
    background: linear-gradient(135deg, var(--secondary) 0%, white 100%);
}

.calendar-day.has-appointment.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.calendar-day.has-appointment.selected .calendar-appointment-indicator {
    color: #065f46;
}

.calendar-day.has-appointment::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 600;
}

.calendar-appointment-indicator {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: auto;
}

.appointment-detail-container {
    position: sticky;
    top: var(--space-4);
}

.appointment-detail-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.no-appointment-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--gray-500);
    text-align: center;
}

.no-appointment-selected i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    color: var(--gray-300);
}

.appointment-detail-header {
    padding: var(--space-4);
    background: var(--gradient-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.appointment-detail-date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary-dark);
    font-weight: 600;
}

.appointment-detail-content {
    padding: var(--space-1);
}

.appointment-item {
    padding: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.appointment-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.appointment-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--success);
    font-weight: 600;
}

.appointment-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.appointment-title h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
}

.appointment-location {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-600);
    margin-bottom: var(--space-2);
    font-size: 0.8rem;
}

.appointment-notes {
    background: var(--gray-100);
    padding: var(--space-3);
    border-radius: var(--radius);
    color: var(--gray-700);
    font-style: italic;
    margin-bottom: var(--space-3);
    font-size: 0.9rem;
}

.appointment-actions {
    display: flex;
    gap: var(--space-2);
}

.appointment-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .appointments-layout {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .appointment-detail-container {
        position: static;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: var(--space-1);
    }
    
    .calendar-controls span {
        min-width: 120px;
        font-size: 0.875rem;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal form {
    padding: var(--space-6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-title-text {
        display: none;
    }

    .nav-item-text {
        display: none;
    }

    .sidebar {
        display: none;
    }
    
    .main {
        width: 100%;
        padding: var(--space-2) var(--space-1);
    }

    .card-header {
        padding: var(--space-1);
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        padding: var(--space-2);
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }

    .sort-select {
        padding: var(--space-2) var(--space-3);
    }

    .listing-title a {
        font-size: 0.9rem;
        line-height: normal;
    }

    .vote-controls {
        gap: var(--space-1);
    }

    .controls {
        justify-content: center;
    }
    
    .addresses-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Print Styles */
@media print {
    .sidebar,
    .card-actions,
    .header-actions,
    .vote-controls,
    .quick-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .listing-card,
    .property-details,
    .location-section,
    .description-section {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-outline {
        border-width: 2px;
    }
    
    .listing-card {
        border-width: 2px;
    }
    
    .status-badge {
        border: 1px solid;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .listing-card:hover,
    .btn:hover {
        transform: none;
    }
}