/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    color: #d40570;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 1.35rem;
    color: #d40570;
    margin: 0;
    font-weight: 700;
}

.header .subtitle-en {
    margin: 0;
    font-weight: 700;
}

.logo {
    height: 70px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

@media (min-width: 992px) {
    .logo {
        height: 100px;
        max-width: 360px;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Button Styles */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    text-transform: none;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Header-specific buttons in ALL CAPS */
#addCarBtn,
#adminLoginBtn {
    text-transform: uppercase;
}

#addCarBtn {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    border-radius: 32px;
}

@media (min-width: 768px) {
    #addCarBtn {
        padding: 1.4rem 3.5rem;
        font-size: 1.25rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #d40570, #5770d3);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #be045f, #4560c0);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 5, 112, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #5770d3, #162604);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4560c0, #0f1a03);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(87, 112, 211, 0.3);
}

.btn-admin {
    background: linear-gradient(135deg, #162604, #5770d3);
    color: white;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #0f1a03, #4560c0);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(22, 38, 4, 0.3);
}


.admin-footer-actions {
    text-align: right;
    margin-top: 0.5rem;
}

.admin-login-link {
    background: none;
    border: none;
    color: #5770d3;
    text-decoration: underline;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: none;
    border-radius: 0;
}

.btn-logout {
    background: linear-gradient(135deg, #d40570, #162604);
    color: white;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #be045f, #0f1a03);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 5, 112, 0.3);
}

.btn-approve {
    background: linear-gradient(135deg, #162604, #5770d3);
    color: white;
    padding: 8px 16px;
    font-size: 11px;
    border-radius: 20px;
}

.btn-approve:hover {
    background: linear-gradient(135deg, #0f1a03, #4560c0);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(22, 38, 4, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #d40570, #5770d3);
    color: white;
    padding: 8px 16px;
    font-size: 11px;
    border-radius: 20px;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #be045f, #4560c0);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 5, 112, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #5770d3, #d40570);
    color: white;
    padding: 8px 16px;
    font-size: 11px;
    border-radius: 20px;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #4560c0, #be045f);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(87, 112, 211, 0.3);
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.intro-section {
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(212, 5, 112, 0.1);
    border-left: 4px solid #d40570;
}

.intro-text {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.subtitle-en {
    font-size: 0.95rem;
    color: #333;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

/* Filters Section */
.filters-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(212, 5, 112, 0.1);
}

.filters-section h2 {
    color: #d40570;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 1px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

#clearFilters {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    height: 48px;
    align-self: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-group label {
    font-weight: 600;
    color: #5770d3;
    text-transform: none;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.filter-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(87, 112, 211, 0.2);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: #d40570;
    box-shadow: 0 0 0 3px rgba(212, 5, 112, 0.2);
}

.filter-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(87, 112, 211, 0.2);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filter-group input:focus {
    outline: none;
    border-color: #d40570;
    box-shadow: 0 0 0 3px rgba(212, 5, 112, 0.2);
}

/* Cars Grid */
.cars-section {
    margin-bottom: 3rem;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.car-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(87, 112, 211, 0.1);
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.car-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.car-card:hover .car-image {
    transform: scale(1.05);
}

.car-info {
    padding: 2rem;
}

.car-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #d40570;
    margin-bottom: 0.8rem;
    text-transform: none;
    letter-spacing: 0.5px;
}

.car-type {
    color: #5770d3;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    text-transform: none;
    letter-spacing: 2px;
    font-weight: 500;
}

.car-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #162604;
    margin-bottom: 1.5rem;
}

.price-change {
    margin-left: 8px;
    font-size: 1rem;
}

.price-change.up {
    color: #28a745;
}

.price-change.down {
    color: #dc3545;
}

.car-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
}

.pending-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffc107;
    color: #212529;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: none;
}

.pending-section {
    margin-top: 3rem;
}

.pending-section h2 {
    color: #dc3545;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.no-cars-message {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.no-cars-message p {
    font-size: 1.2rem;
    color: #6c757d;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    overflow-y: auto; /* Allow scrolling when content exceeds viewport */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: calc(100vh - 80px); /* Keep modal within viewport */
    overflow-y: auto; /* Scroll inner content if it overflows */
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: #d40570;
    transition: all 0.3s ease;
}

.close:hover {
    color: #be045f;
    transform: rotate(90deg);
}

.modal h2 {
    margin-bottom: 2rem;
    color: #d40570;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    text-transform: none;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #5770d3;
    text-transform: none;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(87, 112, 211, 0.2);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #d40570;
    box-shadow: 0 0 0 3px rgba(212, 5, 112, 0.2);
}

/* Footer */
footer {
    background: #363648;
    color: white;
    text-align: left;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 3px solid #d40570;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-transform: none;
    letter-spacing: 2px;
    color: white;
}

.footer-content p {
    margin-bottom: 0.8rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Fine print for important notice in footer */
.footer-content .name {
    font-size: 32px; 
    font-weight: 700;
    font-style: normal;
    font-family: sans-serif, inherit;
}


.footer-content .fine-print {
    font-size: 10px; /* very small font size */
    line-height: 1.4;
    opacity: 0.95;
}

/* Fine print for important notice in footer */
.footer-content .copyright {
    font-size: 13px; /* normal font size */
}

.footer-content .contact {
    font-size: 14px;
    margin-top: 0.5rem;
}

.footer-content .contact a {
    color: #f9f7f7;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        min-width: 100%;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        max-height: calc(100vh - 40px);
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-buttons {
        justify-content: center;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 2rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .car-actions {
        flex-direction: column;
    }

    /* Constrain modal content and keep submit reachable */
    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 1.25rem;
        max-height: calc(100vh - 20px);
    }
    .modal-content form .btn[type="submit"] {
        position: sticky;
        bottom: 0;
        display: block;
        width: 100%;
        margin-top: 1rem;
    }

    .header .subtitle-en {
        font-size: 0.8rem;
    }

    .header .header-title {
        font-size: 0.8rem;
    }

    .filters .filter-group:first-child {
        display: none;
    }
    
    .intro-text {
        font-size: 0.95rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Admin Panel */
.admin-panel {
    background: linear-gradient(135deg, #d40570, #5770d3);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.admin-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-transform: none;
    letter-spacing: 2px;
    color: white;
    text-align: center;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    display: block;
    color: white;
    margin-bottom: 0.5rem;
}

.pending-cars {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pending-cars h4 {
    margin-bottom: 1rem;
    color: white;
    font-size: 1.2rem;
    text-transform: none;
    letter-spacing: 1px;
}

