/* 
 * Customer-Facing Pages Styles
 * This file contains common styles for customer-facing pages
 * Used by compatibility search, key lookup, and other public interfaces
 * 
 * DO NOT duplicate these styles in individual PHP files
 * Import this file instead: <link rel="stylesheet" href="../assets/css/customer-styles.css">
 */

/* =================================
   GRID LAYOUTS
   ================================= */

/* Makers Grid Styling */
.makers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.maker-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.maker-option:hover {
    background: #fff3e0;
    border-color: #ff9800;
    transform: translateY(-2px);
}

.maker-option.selected {
    background: #ff9800;
    border-color: #f57c00;
    color: white;
}

.maker-option h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Country Selection Styling */
.country-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.country-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.country-option:hover {
    background: #fff3e0;
    border-color: #ff9800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.country-option.selected {
    background: #ff9800;
    border-color: #f57c00;
    color: white;
}

.country-option h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

/* Search Type Selection Styling */
.search-type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.search-type-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-type-option:hover {
    background: #fff3e0;
    border-color: #ff9800;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.15);
}

.search-type-option h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.search-type-option p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* =================================
   TABLE STYLES
   ================================= */

/* Vehicles Table Styling */
.vehicles-table-container, .vehicle-models-container {
    margin-top: 20px;
}

.vehicles-data-table, .key-types-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.vehicles-data-table th, .key-types-data-table th {
    background: #ff9800;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.vehicles-data-table td, .key-types-data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.vehicle-row, .key-type-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.vehicle-row:hover, .key-type-row:hover {
    background-color: #f8f9fa;
}

.vehicle-row.selected, .key-type-row.selected {
    background-color: #fff3e0;
}

.vehicle-row:last-child td, .key-type-row:last-child td {
    border-bottom: none;
}

/* Key Types Table Styling */
.key-types-table-container {
    margin-top: 20px;
}

/* =================================
   STATUS INDICATORS
   ================================= */

/* Status indicators for key cutting */
.status-yes {
    background: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-no {
    background: #f44336;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-unknown {
    background: transparent;
    color: #333333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-conditional {
    background: #ff9800;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* =================================
   COMPATIBLE KEYS SECTION
   ================================= */

/* Compatible keys section styling */
.compatible-keys-table {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

/* Compatible keys mobile layout */
.compatible-keys-mobile {
    display: block;
}

.compatible-key-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compatible-key-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.compatible-key-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    margin-right: 15px;
    background: white;
}

.compatible-key-main {
    flex: 1;
}

.compatible-key-number {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.compatible-key-type {
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.compatible-key-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.service-status {
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.service-status.available {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.service-status.not-available {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.service-status.conditional {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Additional compatible key card styles for new layout */
.compatible-keys-mobile-cards {
    display: none;
}

.compatible-keys-cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compatible-key-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.compatible-key-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.compatible-key-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.compatible-key-info {
    flex: 1;
    min-width: 0;
}

.compatible-key-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.compatible-key-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 13px;
}

.service-item:last-child {
    border-bottom: none;
}

.service-label {
    color: #666;
    font-weight: 500;
}

/* =================================
   KEY IMAGE STYLING
   ================================= */

/* Key image styling */
.key-image {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    background: white;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.key-image:hover {
    transform: scale(1.1);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.key-image-cell {
    text-align: center;
    padding: 8px;
    width: 100px;
}

/* =================================
   MODAL STYLES
   ================================= */

/* Image popup modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.image-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-info {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =================================
   LOADING AND ERROR MESSAGES
   ================================= */

/* Loading and Error Messages */
.loading-message, .error-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error-message {
    color: #d32f2f;
}

/* =================================
   RESULTS AND NOTICES
   ================================= */

.results-notes {
    background: #fff3e0;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
}

.results-notes h4 {
    margin-top: 0;
    color: #e65100;
}

.results-notes ul {
    margin-bottom: 0;
}

.results-notes li {
    margin-bottom: 5px;
}

/* =================================
   NAVIGATION ELEMENTS
   ================================= */

/* Breadcrumb styling */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 14px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.breadcrumb:hover {
    background: #e9ecef;
    color: #212529;
    text-decoration: none;
    transform: translateX(-2px);
}

.breadcrumb:active {
    transform: translateX(-1px);
}

/* Back button styling */
.form-actions {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.btn.btn-outline {
    background: transparent;
    border: 2px solid #666;
    color: #666;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn.btn-outline:hover {
    background: #666;
    color: white;
}

/* =================================
   PAGE LAYOUT
   ================================= */

/* Page header mobile adjustments */
.page-header {
    padding: 20px 0;
}

.page-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 14px;
    margin-bottom: 15px;
}

.update-notice {
    padding: 15px;
    margin: 15px 0;
}

.update-notice p {
    font-size: 13px;
    margin-bottom: 8px;
}

/* Search steps mobile */
.search-step h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* Container padding */
.container {
    padding: 0 15px;
}

/* =================================
   MOBILE RESPONSIVE STYLES
   ================================= */

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Grid adjustments */
    .makers-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .maker-option {
        padding: 15px 10px;
    }
    
    /* Country selection responsive */
    .country-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .country-option {
        padding: 30px 15px;
        min-height: 100px;
    }
    
    .country-option h2 {
        font-size: 20px;
    }
    
    /* Search type selection responsive */
    .search-type-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-type-option {
        padding: 25px 15px;
    }
    
    .search-type-option h3 {
        font-size: 16px;
    }
    
    .search-type-option p {
        font-size: 13px;
    }
    
    /* Hide tables and show card layout on mobile */
    .vehicles-data-table, .key-types-data-table {
        display: none;
    }
    
    /* Mobile responsive for compatible keys */
    .compatible-keys-table {
        display: none !important;
    }
    
    .compatible-keys-mobile-cards {
        display: block !important;
    }
    
    /* Mobile card layout for vehicles */
    .vehicles-mobile-cards {
        display: block;
    }
    
    .vehicle-card {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .vehicle-card:hover {
        background: #f8f9fa;
        border-color: #ff9800;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .vehicle-card.selected {
        background: #fff3e0;
        border-color: #ff9800;
        border-width: 2px;
    }
    
    .vehicle-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .vehicle-model {
        font-size: 16px;
        font-weight: bold;
        color: #333;
        line-height: 1.2;
    }
    
    .vehicle-year {
        font-size: 12px;
        color: #666;
        background: #f8f9fa;
        padding: 4px 8px;
        border-radius: 4px;
        white-space: nowrap;
    }
    
    .vehicle-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        font-size: 13px;
    }
    
    .vehicle-detail {
        display: flex;
        flex-direction: column;
    }
    
    .vehicle-detail-label {
        font-size: 11px;
        color: #666;
        margin-bottom: 2px;
        font-weight: 600;
    }
    
    .vehicle-detail-value {
        color: #333;
        font-weight: 500;
    }
    
    /* Mobile card layout for key types */
    .key-types-mobile-cards {
        display: block;
    }
    
    .key-type-card {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .key-type-card:hover {
        background: #f8f9fa;
        border-color: #ff9800;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .key-type-card.selected {
        background: #fff3e0;
        border-color: #ff9800;
        border-width: 2px;
    }
    
    .key-type-card-header {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .key-type-image {
        width: 50px;
        height: 50px;
        object-fit: contain;
        border-radius: 4px;
        border: 1px solid #e9ecef;
        margin-right: 12px;
        background: white;
    }
    
    .key-type-main {
        flex: 1;
    }
    
    .key-type-number {
        font-size: 16px;
        font-weight: bold;
        color: #333;
        margin-bottom: 2px;
    }
    
    .key-type-category {
        font-size: 12px;
        color: #666;
        background: #f8f9fa;
        padding: 2px 6px;
        border-radius: 4px;
        display: inline-block;
    }
    
    .key-type-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        font-size: 13px;
    }
    
    .key-type-detail {
        display: flex;
        flex-direction: column;
    }
    
    .key-type-detail-label {
        font-size: 11px;
        color: #666;
        margin-bottom: 2px;
        font-weight: 600;
    }
    
    .key-type-detail-value {
        color: #333;
        font-weight: 500;
    }
}

/* Desktop-only styles */
@media (min-width: 769px) {
    .vehicles-mobile-cards,
    .key-types-mobile-cards,
    .compatible-keys-mobile {
        display: none;
    }
}
