/* === style.css === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    padding: 20px;
}

h2, h3, h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

form {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 700px;
    margin: 20px auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

form input[type="text"],
form input[type="number"],
form input[type="password"],
form input[type="file"],
form textarea {
    width: 100%;
    padding: 10px;
    margin: 6px 0 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

form button {
    padding: 10px 20px;
    background-color: #2a9d8f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

form button:hover {
    background-color: #21867a;
}

.error {
    color: red;
    margin-bottom: 10px;
}

.car-list-container {
    max-width: 900px;
    margin: 0 auto;
}

.car-list li {
    list-style: none;
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 5px solid #2a9d8f;
    border-radius: 5px;
}

.car-list a {
    text-decoration: none;
    color: #2980b9;
}

.car-details-container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.main-car-image {
    width: 100%;
    max-width: 400px;
    display: block;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.gallery-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.gallery-thumb {
    width: 100px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.car-specs {
    list-style: none;
    padding-left: 0;
    line-height: 1.8;
}

/* Dashboard styling */
.dashboard-container {
    max-width: 700px;
    margin: 50px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.dashboard-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.logout-link {
    display: inline-block;
    margin-bottom: 20px;
    color: red;
    text-decoration: none;
}

.dashboard-menu {
    list-style: none;
    padding: 0;
}

.dashboard-menu li {
    margin-bottom: 10px;
}

.dashboard-menu a {
    text-decoration: none;
    color: #007bff;
    font-size: 18px;
}

.dashboard-menu a:hover {
    text-decoration: underline;
}

.upload-container {
    max-width: 700px;
    margin: 50px auto;
    background: #fdfdfd;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
}

.upload-container h2 {
    text-align: center;
    margin-bottom: 25px;
}

.upload-form label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

.upload-form input[type="text"],
.upload-form input[type="number"],
.upload-form input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.upload-form button {
    margin-top: 25px;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.upload-form button:hover {
    background-color: #218838;
}

.success {
    text-align: center;
    color: green;
    font-weight: bold;
    margin-bottom: 20px;
}

/* === NEW ADDITIONS === */

/* Add New Links */
a.add-link {
    display: inline-block;
    margin-left: 10px;
    color: #007bff;
    font-size: 14px;
    text-decoration: none;
    font-weight: bold;
}

a.add-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Image Previews */
#frontPreview {
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: block;
    max-width: 150px;
    height: auto;
}

#galleryPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#galleryPreview img {
    width: 100px;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Mobile responsive tweaks */
@media (max-width: 600px) {
    .gallery-thumb {
        width: 80px;
    }

    .main-car-image {
        max-width: 100%;
    }

    #galleryPreview img {
        width: 80px;
    }

    #frontPreview {
        max-width: 100%;
    }
}
/* === MODAL STYLING === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal-box h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-box input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.modal-box button {
    margin-top: 10px;
    padding: 10px 18px;
    background-color: #2a9d8f;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-box button:hover {
    background-color: #21867a;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.category-list {
    padding-left: 0;
    margin: 25px 0;
}
.category-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    gap: 16px;
}
.category-item span {
    flex: 1;
    font-size: 18px;
    color: #222;
}
.edit-link {
    margin-right: 8px;
    color: #2980b9;
    font-weight: 500;
    text-decoration: underline;
}
.inline-delete-form {
    margin: 0;
    padding: 0;
    display: inline;
}
.delete-btn {
    padding: 6px 20px;
    background: #2a9d8f;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
    margin-left: 8px;
}
.delete-btn:hover {
    background: #e74c3c;
}
.remove-img {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,0,0,0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-img-container { position: relative; display: inline-block; }

.status-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
    padding: 6px 18px;
    border-radius: 22px;
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
}
.sold-tag { background: #e74c3c; }
.reserve-tag { background: #f39c12; top: 46px;}
.limited-tag { background: #0069d9; top: 82px;}

.car-main-flex {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 36px;
    max-width: 1300px;
    margin: 0 auto 60px auto;
    /* Bahar koi overflow: hidden; ya overflow: auto; MAT lagana */
}

.car-left {
    flex: 1.2;
    min-width: 400px;
}

.car-right {
    flex: 1;
    min-width: 340px;
    max-width: 400px;
    position: relative;  /* Required for sticky child */
    /* Koi height ya overflow: hidden; mat lagana */
}

.shipping-box {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 4px 32px #aaa2;
    padding: 36px 32px 32px 32px;
    margin-top: 22px;
    position: sticky;
    top: 32px;    /* Sticky distance from top */
    z-index: 2;
}

.box-title {
    font-size: 1.6rem;
    margin-bottom: 18px;
    font-weight: 700;
    color: #233042;
    letter-spacing: 1px;
}

.shipping-form .form-group {
    margin-bottom: 14px;
}

.shipping-form select,
.shipping-form input[type='text'] {
    width: 100%;
    padding: 7px 10px;
    font-size: 1rem;
    border-radius: 7px;
    border: 1px solid #d5d5d5;
    margin-top: 5px;
}

.shipping-btn {
    display: inline-block;
    margin-top: 10px;
    background: #22aa8e;
    color: #fff;
    font-size: 1.08rem;
    border: none;
    padding: 10px 36px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.shipping-btn:hover {
    background: #16936f;
}

.shipping-result {
    background: #f6faf7;
    border-radius: 14px;
    padding: 14px 18px 10px 18px;
    margin-top: 24px;
    font-size: 1.15rem;
}

.shipping-result p {
    margin: 6px 0;
}
