:root {
    --dark-black: #0a0a0a;
    --dark-charcoal: #1a1a1a;
    --deep-gray: #2d2d2d;
    --medium-gray: #404040;
    --light-gray: #666666;
    --accent-gold: #d4af37;
    --muted-gold: #b8941f;
    --dark-card: #1f1f1f;
    --border-gray: #333333;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-black);
    color: #e0e0e0;
}

.navbar {
    background-color: var(--dark-charcoal) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border-gray);
}

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

.nav-link {
    color: #e0e0e0 !important;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-gold) !important;
}

.hero-section {
    background: linear-gradient(135deg, var(--dark-black) 0%, var(--dark-charcoal) 100%);
    color: #ffffff;
    padding: 120px 0;
    position: relative;
}

.hero-content h1 {
    font-weight: 300;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero-content .lead {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
}

.card {
    border: 1px solid var(--border-gray);
    background-color: var(--dark-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    border-color: var(--medium-gray);
}

.card-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.2rem;
}

.card-text, .card-body {
    color: #cccccc;
}

.btn-primary {
    background-color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    color: var(--dark-black);
    font-weight: 600;
    padding: 10px 25px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--muted-gold);
    border-color: var(--muted-gold);
    color: var(--dark-black);
}

.price-tag {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 1.4rem;
}

.section-title {
    color: #ffffff;
    font-weight: 300;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.feature-icon {
    color: var(--accent-gold);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    background-color: var(--medium-gray) !important;
    color: #ffffff !important;
    font-weight: 500;
}

footer {
    background-color: var(--dark-charcoal) !important;
    color: #cccccc;
    border-top: 1px solid var(--border-gray);
}

.alert-success {
    background-color: var(--deep-gray);
    border: 1px solid var(--accent-gold);
    color: #ffffff;
}

.alert-danger {
    background-color: var(--deep-gray);
    border: 1px solid #dc3545;
    color: #ff6b6b;
}

h4, h5, h6 {
    color: #ffffff;
    font-weight: 600;
}

.text-muted {
    color: var(--light-gray) !important;
}

.container {
    color: #e0e0e0;
}

.bg-light {
    background-color: var(--deep-gray) !important;
}

.car-row-hidden {
    opacity: 0.5;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.car-row-hidden .card-title {
    text-decoration: line-through;
    color: var(--light-gray) !important;
}

.drag-drop-area {
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--dark-card);
}

.drag-drop-area:hover {
    border-color: var(--accent-gold);
    background-color: var(--deep-gray);
}

.drag-drop-area.dragover {
    border-color: var(--accent-gold);
    background-color: var(--deep-gray);
    transform: scale(1.02);
}

.sortable-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.sortable-image {
    position: relative;
    cursor: move;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--dark-card);
}

.sortable-image:hover {
    border-color: var(--accent-gold);
    transform: scale(1.05);
}

.sortable-image.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.sortable-image img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    display: block;
}

.sortable-image .image-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.sortable-image .image-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0,0,0,0.8);
    color: var(--accent-gold);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.image-control-btn {
    background: rgba(0,0,0,0.8);
    border: none;
    color: #fff;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-control-btn:hover {
    background: rgba(0,0,0,0.9);
}

.image-control-btn.delete {
    color: #ff6b6b;
}

.image-control-btn.delete:hover {
    background: #ff6b6b;
    color: #fff;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--deep-gray);
    border-radius: 4px;
    margin-bottom: 8px;
}

.file-item .file-name {
    flex-grow: 1;
    margin-left: 8px;
    color: #e0e0e0;
}

.file-item .remove-file {
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
}

.file-item .remove-file:hover {
    color: #ff6b6b;
}

.table {
    color: #cccccc !important;
}

.table td, .table th {
    color: #cccccc !important;
    border-color: var(--border-gray) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.form-select {
    background-color: var(--deep-gray) !important;
    border-color: var(--border-gray) !important;
    color: #cccccc !important;
}

.form-select:focus {
    background-color: var(--deep-gray) !important;
    border-color: var(--accent-gold) !important;
    color: #cccccc !important;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25) !important;
}


/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First - Base styles above are for mobile */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 8px 16px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 input,
    .d-flex.gap-2 .btn {
        width: 100%;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .sortable-image img {
        width: 100px;
        height: 70px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 577px) and (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    
    .table {
        font-size: 0.9rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: var(--dark-charcoal);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
        border: 1px solid var(--border-gray);
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 4px;
    }
    
    .nav-link:hover {
        background-color: var(--deep-gray);
    }
}

/* Admin Panel Responsive */
@media (max-width: 768px) {
    .back-button {
        position: static;
        margin-bottom: 1rem;
        display: inline-block;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between > * {
        width: 100%;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 4px !important;
        margin-bottom: 0.25rem;
    }
}

/* Card Grid Responsive */
@media (max-width: 576px) {
    .row > [class*='col-'] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .price-tag {
        font-size: 1.2rem;
    }
}

/* Form Responsive */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    footer .col-md-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    footer .text-md-start,
    footer .text-md-end {
        text-align: center !important;
    }
}

/* Image Gallery Responsive */
@media (max-width: 576px) {
    .sortable-images {
        justify-content: center;
    }
    
    .drag-drop-area {
        padding: 20px 10px;
    }
}

/* Leasing Modal Responsive */
@media (max-width: 576px) {
    .modal-content {
        border-radius: 0;
    }
    
    .modal-fullscreen-sm-down {
        width: 100vw;
        max-width: none;
        height: 100%;
        margin: 0;
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn {
        min-height: 44px; /* iOS touch target size */
    }
}

/* Horizontal scroll for tables on small screens */
@media (max-width: 992px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive > .table {
        margin-bottom: 0;
    }
}


/* ===== ADMIN PAGES RESPONSIVE ===== */

/* Mobile Admin Header */
@media (max-width: 768px) {
    .container.py-4 h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Admin navigation buttons */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 input[type="text"],
    .d-flex.gap-2 .btn {
        width: 100% !important;
        margin: 0;
    }
    
    /* Back button */
    .back-button {
        position: static !important;
        margin-bottom: 1rem;
        display: inline-block;
    }
    
    /* Admin table actions */
    .table .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        margin: 0.1rem;
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(1),
    .table td:nth-child(1) {
        display: none; /* Hide ID column */
    }
    
    /* Make action buttons stack */
    .table td:last-child {
        white-space: normal;
    }
    
    .table td:last-child .btn {
        display: inline-block;
        margin: 2px;
    }
}

/* Admin Cards Responsive */
@media (max-width: 576px) {
    .card-header {
        padding: 0.75rem;
    }
    
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        border-radius: 0.25rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Admin Forms Responsive */
@media (max-width: 768px) {
    .col-md-6,
    .col-md-8 {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .form-control,
    .form-select,
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    /* Image upload area */
    .drag-drop-area {
        padding: 20px 10px;
        font-size: 0.9rem;
    }
    
    .sortable-images {
        gap: 5px;
    }
    
    .sortable-image img {
        width: 80px;
        height: 60px;
    }
}

/* Leasing Admin Page Responsive */
@media (max-width: 768px) {
    /* Leasing header */
    .d-flex.justify-content-between.align-items-center.mb-2 {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-2 h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-2 > div {
        width: 100%;
    }
    
    /* Save/Cancel buttons */
    #saveButtons {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem !important;
    }
    
    #saveButtons .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    /* Tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Leasing tables */
    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .table-dark {
        font-size: 0.8rem;
    }
    
    .table-dark th,
    .table-dark td {
        padding: 0.4rem;
        vertical-align: middle;
    }
    
    /* Hide contact column on mobile */
    .table-dark th:nth-child(4),
    .table-dark td:nth-child(4) {
        display: none;
    }
    
    /* Stack leasing action buttons */
    .table-dark .btn-sm {
        display: block;
        width: 100%;
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    /* Months paid input */
    .months-input {
        width: 60px !important;
        font-size: 0.85rem !important;
        padding: 0.25rem !important;
    }
}

/* User Management Responsive */
@media (max-width: 768px) {
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none; /* Hide joined date on mobile */
    }
}

/* Page Editor Responsive */
@media (max-width: 768px) {
    .row.justify-content-center {
        margin: 0;
    }
    
    .col-md-8 {
        padding: 0;
    }
    
    textarea[rows] {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .car-main-img { height: 250px !important; }
}

/* Horizontal scroll hint for tables */
@media (max-width: 992px) {
    .table-responsive::after {
        content: '← Scroll →';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--light-gray);
        padding: 0.5rem;
        opacity: 0.7;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: var(--deep-gray);
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--accent-gold);
        border-radius: 4px;
    }
}

/* Touch-friendly admin controls */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    /* Checkbox and radio larger */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px !important;
        height: 20px !important;
        min-height: unset !important;
    }
    
    /* Dropdown menus full width */
    .dropdown-menu {
        width: 100%;
        left: 0 !important;
        right: 0 !important;
    }
}

/* Admin table overflow fix */
@media (max-width: 992px) {
    .table-responsiv {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        display: block;
    }
}
