/* ============================================
   AutoAlchemy - Fullmetal Alchemist Theme Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --primary: #2d8f8f;
    --primary-dark: #236b6b;
    --accent: #c9a227;
    --accent-glow: rgba(201, 162, 39, 0.3);
    --teal-bright: #4a9b9b;
    --text: #f0e6d2;
    --text-dim: #8a8a8a;
    --border: #2a2a2a;
    --border-gold: #5a4a1f;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 20px rgba(45, 143, 143, 0.2);
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    background-image: 
        radial-gradient(ellipse at top, rgba(45, 143, 143, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(74, 155, 155, 0.08) 0%, transparent 50%);
}

/* Diablo-style border decorations */
.diablo-border {
    border: 2px solid var(--border-gold);
    position: relative;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8), var(--shadow-glow);
}

.diablo-border::before,
.diablo-border::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
}

.diablo-border::before {
    top: -2px; left: -2px;
    border-right: none; border-bottom: none;
}

.diablo-border::after {
    bottom: -2px; right: -2px;
    border-left: none; border-top: none;
}

/* Navigation */
.nav {
    background: linear-gradient(180deg, rgba(10,10,12,0.98) 0%, rgba(10,10,12,0.95) 100%);
    border-bottom: 2px solid var(--border-gold);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    text-decoration: none;
    text-shadow: 0 0 10px var(--accent-glow), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.nav-logo span {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(45, 143, 143, 0.5);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
    box-shadow: 0 0 8px var(--primary);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero */
.hero {
    background: 
        linear-gradient(180deg, rgba(13,13,13,0.7) 0%, rgba(13,13,13,0.9) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="80" opacity="0.03">⚗️</text></svg>');
    background-size: cover;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    border-bottom: 3px solid var(--border-gold);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(45, 143, 143, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--teal-bright);
    text-shadow: 
        0 0 20px rgba(74, 155, 155, 0.4),
        0 4px 8px rgba(0,0,0,0.8),
        0 0 40px rgba(45, 143, 143, 0.2);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

/* Search Box */
.search-box {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 4px;
    box-shadow: var(--shadow);
    max-width: 1000px;
    margin: -3rem auto 0;
    position: relative;
    z-index: 10;
    border: 1px solid var(--border-gold);
}

.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.search-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-body);
}

.search-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-shadow: 0 0 8px rgba(45, 143, 143, 0.5);
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group select,
.form-group input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.95rem;
    background: var(--bg-dark);
    color: var(--text);
    transition: all 0.2s;
    font-family: var(--font-body);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(45, 143, 143, 0.3);
}

.form-group select option {
    background: var(--bg-dark);
    color: var(--text);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 2px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: 1px solid var(--primary-dark);
    box-shadow: 0 4px 15px rgba(45, 143, 143, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #994000 100%);
    box-shadow: 0 4px 20px rgba(45, 143, 143, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(45, 143, 143, 0.1);
    box-shadow: 0 0 10px rgba(45, 143, 143, 0.3);
}

/* Sections */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.section-subtitle {
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blood) 0%, var(--primary) 50%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-gold);
}

.card:hover::before {
    opacity: 1;
}

.card-img {
    height: 200px;
    background: linear-gradient(135deg, #1a0a0a 0%, #2a1515 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-text {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.card-meta span {
    background: rgba(45, 143, 143, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    border: 1px solid rgba(45, 143, 143, 0.2);
    color: var(--primary);
}

/* Vehicle Table */
.vehicle-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.vehicle-table table {
    width: 100%;
    border-collapse: collapse;
}

.vehicle-table th {
    background: linear-gradient(180deg, #1a0a0a 0%, #0a0a0c 100%);
    color: var(--accent);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-gold);
}

.vehicle-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.vehicle-table tr:hover td {
    background: var(--bg-card-hover);
}

.vehicle-table .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 2px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green { 
    background: rgba(0, 128, 0, 0.2); 
    color: #00ff00; 
    border: 1px solid rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}
.badge-yellow { 
    background: rgba(201, 162, 39, 0.1); 
    color: var(--accent); 
    border: 1px solid rgba(201, 162, 39, 0.3);
}
.badge-red { 
    background: rgba(45, 143, 143, 0.3); 
    color: #ff4444; 
    border: 1px solid rgba(255, 0, 0, 0.3);
}
.badge-blue { 
    background: rgba(0, 100, 255, 0.1); 
    color: #66aaff; 
    border: 1px solid rgba(100, 150, 255, 0.3);
}

/* Info Section */
.info-section {
    background: linear-gradient(180deg, #0f0805 0%, #1a0a05 100%);
    padding: 4rem 2rem;
    position: relative;
    border-top: 2px solid var(--border-gold);
    border-bottom: 2px solid var(--border-gold);
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(45, 143, 143, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(74, 155, 155, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.info-section h2 {
    text-align: center;
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--accent-glow);
}

.info-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.info-card {
    text-align: center;
    padding: 2rem;
    background: rgba(18, 18, 26, 0.8);
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.info-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-glow);
}

.info-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-card p {
    opacity: 0.8;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 4px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(45, 143, 143, 0.5);
}

.stat-label {
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background: #050505;
    color: rgba(255,255,255,0.7);
    padding: 3rem 2rem 1.5rem;
    border-top: 2px solid var(--border-gold);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-section a:hover { color: var(--primary); }

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: 4px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(45, 143, 143, 0.2), var(--shadow);
    border: 1px solid var(--border-gold);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.5;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(45, 143, 143, 0.05) 0%, transparent 100%);
}

.modal-header h3 {
    font-family: var(--font-display);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s;
}

.modal-close:hover {
    border-color: var(--blood-bright);
    color: var(--blood-bright);
}

.modal-body { padding: 1.5rem; }

/* Part Results */
.part-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.part-item {
    background: rgba(45, 143, 143, 0.03);
    padding: 1rem;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.part-item:hover {
    border-color: var(--border-gold);
    background: rgba(45, 143, 143, 0.05);
}

.part-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.part-item-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Used Car Sales */
.sales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.sale-card {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.sale-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-gold);
}

.sale-card-img {
    height: 220px;
    background: linear-gradient(135deg, #1a0a0a 0%, #2a1515 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
}

.sale-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.sale-price {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--blood) 0%, #660000 100%);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 2px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.3);
    z-index: 2;
}

.sale-card-body {
    padding: 1.5rem;
}

.sale-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sale-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.sale-card-meta span {
    background: rgba(45, 143, 143, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--primary);
    border: 1px solid rgba(45, 143, 143, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2rem; letter-spacing: 2px; }
    .search-box { margin: -2rem 1rem 0; }
    .search-form { grid-template-columns: 1fr; }
    .container { padding: 3rem 1rem; }
    .vehicle-table { overflow-x: auto; }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(45, 143, 143, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
