/* Autodiely Frontend Styles */

.autodiely-archive {
    max-width: 1200px;
    margin: 0 auto;
}

.autodiely-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.autodiely-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.filter-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input {
    width: 200px;
}

.filter-group select {
    width: 150px;
}

#apply-filters,
#clear-filters {
    margin-top: 20px;
    margin-right: 10px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ast-global-color-0);
}

.results-header h2 {
    margin: 0;
    color: #333;
}

.results-count {
    color: #666;
    font-size: 14px;
}

.autodiely-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.autodiel-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.autodiel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

.price-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--ast-global-color-0);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.card-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-content h3 a:hover {
    color: var(--ast-global-color-0);
}

.card-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.card-category {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.card-status.status-novy {
    background: #d4edda;
    color: #155724;
}

.card-status.status-pouzivany {
    background: #fff3cd;
    color: #856404;
}

.card-oe-numbers {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

.more-oe {
    color: var(--ast-global-color-0);
    font-weight: bold;
}

.card-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.card-price {
    margin-bottom: 15px;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
}

.newest-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.newest-actions .view-detail-btn {
    flex: 1;
    text-align: center;
}

.newest-actions .contact-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.newest-actions .contact-button:hover {
    background: #218838;
}

/* Ensure newest-item styles are applied in archive */
.autodiely-grid .newest-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.autodiely-grid .newest-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.autodiely-grid .newest-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.autodiely-grid .newest-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.autodiely-grid .newest-item:hover .newest-image img {
    transform: scale(1.05);
}

.autodiely-grid .newest-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: auto!important;
}

.autodiely-grid .newest-item-title {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.autodiely-grid .newest-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.autodiely-grid .newest-item-title a:hover {
    color: var(--ast-global-color-0);
}

.autodiely-grid .newest-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.autodiely-grid .newest-category {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.autodiely-grid .newest-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.autodiely-grid .newest-status.status-novy {
    background: #d4edda;
    color: #155724;
}

.autodiely-grid .newest-status.status-pouzivany {
    background: #fff3cd;
    color: #856404;
}

.autodiely-grid .newest-excerpt {
    margin-bottom: 0;
    color: #666;
    line-height: 1.5;
    height: 4.5em; /* Fixed height for exactly 3 lines */
    overflow: hidden;
    position: relative;
}

.autodiely-grid .newest-excerpt p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    max-height: 4.5em;
}

.autodiely-grid .newest-price {
    margin-top: 10px;
    margin-bottom: 0;
}

.autodiely-grid .newest-actions {
    margin-top: 10px;
}

.autodiely-grid .price-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
}

.autodiely-grid .newest-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.autodiely-grid .newest-actions .view-detail-btn {
    flex: 1;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    height: 40px;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autodiely-grid .newest-actions .view-detail-btn:hover {
    background: #218838;
    color: white;
}

.autodiely-grid .newest-actions .contact-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    height: 40px;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autodiely-grid .newest-actions .contact-button:hover {
    background: #218838;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-actions .button {
    flex: 1;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.card-actions .button:first-child {
    display: inline-block;
    background: var(--ast-global-color-0);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.card-actions .button:first-child:hover {
    background: var(--ast-global-color-0);
    color: white;
}

.contact-button {
    background: #28a745;
    color: white;
}

.contact-button:hover {
    background: #1e7e34;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.pagination {
    text-align: center;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ast-global-color-0);
}

.pagination .current {
    background: var(--ast-global-color-0);
    color: white;
    border-color: var(--ast-global-color-0);
}

.pagination a:hover {
    background: #f8f9fa;
}

/* Contact Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

.modal-content.large {
    max-width: 800px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close:hover {
    color: #000;
}

.contact-info {
    margin-top: 20px;
}

.contact-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.contact-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.reveal-button {
    background: var(--ast-global-color-0);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.reveal-button:hover {
    background: #0056b3;
}

.contact-revealed {
    color: var(--ast-global-color-0);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.contact-revealed:hover {
    color: var(--ast-global-color-0);
    text-decoration: underline;
}

/* Dashboard Styles */
.autodiely-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin-bottom: 20px;
    color: #333;
}

.dashboard-tabs {
    border-bottom: 2px solid #dee2e6;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--ast-global-color-0);
    border-bottom-color: var(--ast-global-color-0);
    font-weight: bold;
}

.tab-button:hover {
    color: var(--ast-global-color-0);
}

.tab-content {
    display: none;
    margin-top: 30px;
}

.tab-content.active {
    display: block;
}

.form-container,
.manage-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

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

.gallery-upload {
    margin-top: 10px;
}

#gallery-preview,
#edit-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#gallery-preview .gallery-item,
#edit-gallery-preview .gallery-item {
    flex: 0 0 auto;
    width: calc((100% - 30px) / 4); /* 4 columns with gaps */
    min-width: 100px;
}

@media (max-width: 768px) {
    #gallery-preview .gallery-item,
    #edit-gallery-preview .gallery-item {
        width: calc((100% - 10px) / 2); /* 2 columns on mobile */
    }
}

/* Sortable gallery styles */
.sortable-gallery {
    position: relative;
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
}

.sortable-gallery.ui-sortable {
    display: flex !important;
}

.gallery-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    cursor: move;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    width: calc((100% - 30px) / 4);
    min-width: 100px;
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc((100% - 10px) / 2);
    }
}

.gallery-item::before {
    content: '⋮⋮';
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover {
    border-color: var(--ast-global-color-0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.gallery-item.ui-sortable-helper {
    opacity: 0.9;
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000 !important;
    cursor: grabbing !important;
    transition: none !important; /* Disable transitions during drag for better performance */
}

.gallery-item.ui-sortable-helper img {
    pointer-events: none; /* Prevent image dragging issues */
}

.gallery-item-placeholder {
    border: 2px dashed var(--ast-global-color-0) !important;
    background: rgba(0, 123, 255, 0.15) !important;
    border-radius: 4px;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0;
    box-sizing: border-box;
}

.gallery-item.ui-sortable-placeholder {
    border: 2px dashed var(--ast-global-color-0) !important;
    background: rgba(0, 123, 255, 0.25) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    margin: 0 !important;
    box-sizing: border-box;
    position: relative;
}

.gallery-item.dragging {
    opacity: 0.3;
    transform: scale(0.95);
    transition: opacity 0.2s ease;
}

.sortable-gallery {
    position: relative;
}

.sortable-gallery.ui-sortable-disabled {
    opacity: 0.6;
}

.gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.oe-numbers-container {
    margin-top: 10px;
}

.oe-number-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.oe-number-item input {
    flex: 1;
}

.remove-oe {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.form-actions .button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.button-primary {
    background: var(--ast-global-color-0);
    color: white;
}

.button-primary:hover {
    background: #0056b3;
}

.button {
    background: #6c757d;
    color: white;
}

.button:hover {
    background: #545b62;
}

.manage-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.search-controls {
    flex: 1;
}

.search-controls input {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.listings-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.listings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.listings-table th,
.listings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.listings-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.listings-table tr:hover {
    background: #f8f9fa;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-trash {
    background: #f8d7da;
    color: #721c24;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .autodiely-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        display: block;
        margin-bottom: 15px;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .manage-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls input {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-content.large {
        width: 95%;
    }
}

/* ========================================
   SINGLE AUTODIEL TEMPLATE STYLES
   ======================================== */

.autodiely-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.autodiely-breadcrumb {
    margin-bottom: 20px;
}

.autodiely-breadcrumb a {
    color: var(--ast-global-color-0);
    text-decoration: none;
    font-weight: 600;
}

.autodiely-breadcrumb a:hover {
    text-decoration: underline;
}

.autodiely-single-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 20px;
}

/* Gallery Section */
.autodiely-gallery-section {
    position: sticky;
    top: 20px;
}

.autodiely-gallery-main {
    margin-bottom: 15px;
}

.autodiely-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autodiely-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.autodiely-thumb {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.autodiely-thumb.active {
    border-color: var(--ast-global-color-0);
}

.autodiely-thumb-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.autodiely-no-image {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.autodiely-no-image-placeholder {
    text-align: center;
    color: #6c757d;
}

.autodiely-no-image-placeholder .dashicons {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Details Section */
.autodiely-details-section {
    padding: 20px 0;
}

.autodiely-single-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.2;
}

.autodiely-price {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.autodiely-price-label {
    font-weight: 600;
    color: #155724;
    margin-right: 10px;
}

.autodiely-price-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
}

.autodiely-meta {
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.autodiely-meta-label {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
}

.autodiely-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.autodiely-status-badge.status-novy {
    background: #d4edda;
    color: #155724;
}

.autodiely-status-badge.status-pouzivany {
    background: #fff3cd;
    color: #856404;
}

.autodiely-category-name {
    color: var(--ast-global-color-0);
    font-weight: 600;
}

/* Vehicle Details */
.autodiely-vehicle-details {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.autodiely-vehicle-details h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.25rem;
}

.autodiely-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.autodiely-vehicle-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.autodiely-vehicle-label {
    font-weight: 600;
    color: #6c757d;
}

.autodiely-vehicle-value {
    color: #495057;
    font-weight: 500;
}

/* OE Numbers */
.autodiely-oe-numbers {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.autodiely-oe-numbers h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.25rem;
}

.autodiely-oe-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.autodiely-oe-item {
    background: var(--ast-global-color-0);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Description */
.autodiely-description {
    margin-bottom: 30px;
}

.autodiely-description h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.25rem;
}

.autodiely-description-content {
    line-height: 1.6;
    color: #495057;
}

.autodiely-description-content p {
    margin-bottom: 15px;
}

/* Contact Section */
.autodiely-contact-section {
    padding: 20px;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid var(--ast-global-color-0);
}

.autodiely-contact-section h3 {
    margin-bottom: 15px;
    color: #1565c0;
    font-size: 1.25rem;
}

.autodiely-contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.autodiely-contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.autodiely-contact-label {
    font-weight: 600;
    color: #1565c0;
}

.autodiely-contact-value {
    color: #1565c0;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
}

.autodiely-contact-value:hover {
    color: #0d47a1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .autodiely-single-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .autodiely-single-title {
        font-size: 2rem;
    }
    
    .autodiely-main-image {
        height: 300px;
    }
    
    .autodiely-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .autodiely-vehicle-grid {
        grid-template-columns: 1fr;
    }
    
    .autodiely-contact-info {
        gap: 10px;
    }
}

/* ========================================
   ADMIN DASHBOARD STYLES
   ======================================== */

/* Dashboard Container */
.autodiely-dashboard {
    /* Ensure proper spacing and layout */
}

/* Tab Buttons - Only for dashboard tabs */
.autodiely-dashboard .tab-button {
    background: transparent;
    color: var(--ast-global-color-0);
    border: 1px solid var(--ast-global-color-0);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.autodiely-dashboard .tab-button:hover {
    background: var(--ast-global-color-0);
    color: white;
}

.autodiely-dashboard .tab-button.active {
    background: var(--ast-global-color-0);
    color: white;
}

/* Submit Button - Only for create/edit forms */
.autodiely-dashboard button[type="submit"] {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.autodiely-dashboard button[type="submit"]:hover {
    background: #218838;
}

.autodiely-dashboard button[type="submit"]:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Reset Button - Only for dashboard reset button */
.autodiely-dashboard #reset-form {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.autodiely-dashboard #reset-form:hover {
    background: #dc3545;
    color: white;
}

/* Dashboard Action Buttons */
.autodiely-dashboard .button.edit-listing {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.autodiely-dashboard .button.edit-listing:hover {
    background: #218838;
}

.autodiely-dashboard .button.delete-listing {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.autodiely-dashboard .button.delete-listing:hover {
    background: #c82333;
}

.autodiely-dashboard .button.restore-listing {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.autodiely-dashboard .button.restore-listing:hover {
    background: #218838;
}

/* Gallery Management */
.autodiely-dashboard .gallery-item {
    position: relative;
    display: inline-block;
    margin: 5px;
    cursor: move;
    transition: all 0.2s ease;
}

.autodiely-dashboard .gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.autodiely-dashboard .gallery-item.ui-sortable-helper {
    opacity: 0.9;
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000 !important;
    cursor: grabbing !important;
    transition: none !important;
}

.autodiely-dashboard .gallery-item.ui-sortable-helper img {
    pointer-events: none;
}

.autodiely-dashboard .gallery-item-placeholder,
.autodiely-dashboard .gallery-item.ui-sortable-placeholder {
    border: 2px dashed var(--ast-global-color-0) !important;
    background: rgba(0, 123, 255, 0.15) !important;
    border-radius: 4px;
    visibility: visible !important;
    display: inline-block !important;
    opacity: 1 !important;
    margin: 5px;
    width: 100px;
    height: 100px;
    box-sizing: border-box;
}

/* Admin meta box gallery styles */
#gallery-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#gallery-images .gallery-image-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    cursor: move;
    transition: all 0.2s ease;
}

#gallery-images .gallery-image-item:hover {
    border-color: var(--ast-global-color-0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

#gallery-images .gallery-image-item.ui-sortable-helper {
    opacity: 0.9;
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000 !important;
    cursor: grabbing !important;
    transition: none !important;
}

#gallery-images .gallery-image-item.ui-sortable-helper img {
    pointer-events: none;
}

#gallery-images .gallery-image-item.dragging {
    opacity: 0.3;
    transform: scale(0.95);
    transition: opacity 0.2s ease;
}

#gallery-images .gallery-item-placeholder,
#gallery-images .gallery-image-item.ui-sortable-placeholder,
#gallery-images .drag-placeholder {
    border: 2px dashed var(--ast-global-color-0) !important;
    background: rgba(0, 123, 255, 0.25) !important;
    border-radius: 4px;
    width: 100px !important;
    height: 100px !important;
    visibility: visible !important;
    display: inline-block !important;
    opacity: 1 !important;
    margin: 0 !important;
    box-sizing: border-box;
    flex: 0 0 auto;
}

/* Prevent image dragging interference */
.gallery-item img,
.gallery-image-item img {
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

.gallery-item,
.gallery-image-item {
    user-select: none;
}

.autodiely-dashboard .gallery-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.autodiely-dashboard .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

/* OE Numbers Management */
.autodiely-dashboard .oe-number-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.autodiely-dashboard .oe-number-item input {
    flex: 1;
}

.autodiely-dashboard .remove-oe {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

/* Form Validation */
.autodiely-dashboard .error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.autodiely-dashboard .loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Modal Styling */
.autodiely-dashboard .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autodiely-dashboard .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.autodiely-dashboard .modal-content.large {
    max-width: 95vw;
    width: 95vw;
    max-height: 95vh;
}

.autodiely-dashboard .modal-content form {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    max-height: calc(95vh - 100px);
}

/* Lock body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Ensure modal content itself scrolls smoothly */
.autodiely-dashboard .modal-content {
    -webkit-overflow-scrolling: touch;
}

.autodiely-dashboard .modal-content form::-webkit-scrollbar {
    width: 8px;
}

.autodiely-dashboard .modal-content form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.autodiely-dashboard .modal-content form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.autodiely-dashboard .modal-content form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.autodiely-dashboard .modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-right: 50px;
}

.autodiely-dashboard .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 10;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.autodiely-dashboard .close:hover {
    color: #000;
    background: #f8f9fa;
}

/* Dashboard Form Styling */
.autodiely-dashboard .form-group {
    margin-bottom: 15px;
}

.autodiely-dashboard .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.autodiely-dashboard .form-group input,
.autodiely-dashboard .form-group textarea,
.autodiely-dashboard .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.autodiely-dashboard .form-row {
    display: flex;
    gap: 15px;
}

.autodiely-dashboard .form-row .form-group {
    flex: 1;
}

/* Dashboard Table Styling */
.autodiely-dashboard .listings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.autodiely-dashboard .listings-table th,
.autodiely-dashboard .listings-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.autodiely-dashboard .listings-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.autodiely-dashboard .status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.autodiely-dashboard .status-published {
    background: #d4edda;
    color: #155724;
}

.autodiely-dashboard .status-draft {
    background: #fff3cd;
    color: #856404;
}

.autodiely-dashboard .status-trash {
    background: #f8d7da;
    color: #721c24;
}
