/* Mobile First Design - Fixed for no horizontal scroll */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding-bottom: 70px;
    background: #f5f5f5;
    position: relative;
}

/* Prevent any overflow */
.container, .wrapper, .main, section, div {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile Navigation */
.mobile-nav {
    background: #1a1a2e;
    color: white;
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
}

.logo a {
    color: #e94560;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.logo a i {
    margin-right: 5px;
}

.search-bar {
    flex: 1;
    max-width: 300px;
    min-width: 100px;
}

.search-bar form {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    width: 100%;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    outline: none;
    font-size: 14px;
    min-width: 60px;
    width: 100%;
}

.search-bar button {
    background: #e94560;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-icons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.nav-icons a {
    color: white;
    font-size: 18px;
    text-decoration: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 28px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.hero-content p {
    font-size: 16px;
    opacity: 0.9;
    word-wrap: break-word;
}

/* Car Listings */
.car-listings {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.car-listings h2 {
    margin-bottom: 20px;
    color: #1a1a2e;
    font-size: 22px;
}

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

.car-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    width: 100%;
    max-width: 100%;
}

.car-card:hover {
    transform: translateY(-5px);
}

.car-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    width: 100%;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.car-status.available {
    background: #4CAF50;
    color: white;
}

.car-status.sold {
    background: #f44336;
    color: white;
}

.car-status.pending {
    background: #ff9800;
    color: white;
}

.car-info {
    padding: 15px;
}

.car-info h3 {
    font-size: 18px;
    color: #1a1a2e;
    word-wrap: break-word;
}

.car-name {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
    word-wrap: break-word;
}

.car-details {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.car-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.car-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: #e94560;
}

.btn-view {
    background: #e94560;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-view:hover {
    background: #c0392b;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
    flex: 1;
    padding: 4px 2px;
    min-width: 0;
}

.bottom-nav a i {
    font-size: 22px;
    margin-bottom: 2px;
}

.bottom-nav a span {
    font-size: 10px;
    white-space: nowrap;
}

.bottom-nav a.active {
    color: #e94560;
}

.bottom-nav a:hover {
    color: #e94560;
}

/* No Cars Message */
.no-cars {
    text-align: center;
    padding: 40px;
    color: #666;
    width: 100%;
}

.no-cars i {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Login/Register Forms */
.auth-form {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 95%;
    max-width: 400px;
    overflow: hidden;
}

.auth-form h2 {
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 20px;
    font-size: 24px;
}

.auth-form .form-group {
    margin-bottom: 20px;
    width: 100%;
}

.auth-form label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    max-width: 100%;
}

.auth-form input:focus {
    outline: none;
    border-color: #e94560;
}

.auth-form .btn-submit {
    width: 100%;
    padding: 12px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-form .btn-submit:hover {
    background: #c0392b;
}

.auth-form .form-links {
    text-align: center;
    margin-top: 20px;
}

.auth-form .form-links a {
    color: #e94560;
    text-decoration: none;
}

.auth-form .form-links a:hover {
    text-decoration: underline;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    flex: 1;
    padding-right: 45px;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
}

/* Alert styles */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Admin Mobile Overrides */
.admin-wrapper,
.admin-content,
.admin-main {
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive Design */
@media (min-width: 768px) {
    .car-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
}

@media (max-width: 767px) {
    .car-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-bar {
        max-width: 180px;
    }
    
    .search-bar input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .nav-icons {
        gap: 8px;
    }
    
    .nav-icons a {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .search-bar {
        max-width: 120px;
        min-width: 80px;
    }
    
    .search-bar input {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .search-bar button {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .car-details {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 13px;
    }
    
    .price {
        font-size: 18px;
    }
    
    .hero-content h1 {
        font-size: 22px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .auth-form {
        padding: 20px;
        margin: 20px auto;
    }
    
    .auth-form h2 {
        font-size: 20px;
    }
    
    .bottom-nav a {
        font-size: 10px;
    }
    
    .bottom-nav a i {
        font-size: 18px;
    }
    
    .bottom-nav a span {
        font-size: 9px;
    }
    
    .car-listings {
        padding: 12px;
    }
    
    .car-image {
        height: 160px;
    }
    
    .car-info {
        padding: 12px;
    }
    
    .car-info h3 {
        font-size: 16px;
    }
    
    .btn-view {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 360px) {
    .search-bar {
        max-width: 80px;
        min-width: 60px;
    }
    
    .search-bar input {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .logo a {
        font-size: 16px;
    }
    
    .nav-icons a {
        font-size: 14px;
    }
    
    .hero-content h1 {
        font-size: 18px;
    }
    
    .car-details {
        font-size: 12px;
        gap: 5px;
    }
    
    .car-details span {
        font-size: 11px;
    }
    
    .price {
        font-size: 16px;
    }
}