/* Custom styles for ECU Programming System */

/* Hide Alpine.js uninitialized content */
[x-cloak] {
    display: none !important;
}

/* Body gradient background */
body {
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
}

/* Drag and drop zone */
.drag-over { 
    border-color: #ef4444 !important; 
    background-color: rgba(239, 68, 68, 0.1) !important; 
}

/* Loading spinner */
.loader {
    border: 3px solid #374151;
    border-top: 3px solid #ef4444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom dropdown styles */
.custom-dropdown {
    position: relative;
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.dropdown-option:hover {
    background: #4b5563;
}

.dropdown-option img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

.dropdown-selected {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #ef4444;
    border-radius: 4px;
}

/* Input field styling */
input, select, textarea {
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ef4444;
    border-color: #ef4444;
}

/* Pulse border animation */
@keyframes pulse-border {
    0% {
        border-color: #fca5a5;
        box-shadow: 0 0 0 0 rgba(252, 165, 165, 0.4);
    }
    50% {
        border-color: #b91c1c;
        box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.2);
    }
    100% {
        border-color: #fca5a5;
        box-shadow: 0 0 0 0 rgba(252, 165, 165, 0.4);
    }
}

/* Pulsing border class - runs continuously */
.pulse-border {
    animation: pulse-border 2s ease-in-out infinite;
}

/* When user clicks into the input - stop pulsing, show solid red */
.pulse-border:focus {
    animation: none !important;
    border-color: #8f2c2c !important;
    border-width: 2px !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
}

/* Vertical Stepper Styles */
.stepper-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #374151;
    border: 2px solid #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-circle.completed {
    background-color: #10b981;
    border-color: #10b981;
}

.step-circle.completed svg {
    stroke: white;
}

.step-content {
    flex: 1;
    padding-bottom: 0.5rem;
}

.step-title {
    font-weight: 600;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.step-title.completed {
    color: #10b981;
}

.step-desc {
    margin-top: 0.25rem;
}

/* Connector lines between steps */
.step-connector {
    width: 2px;
    height: 40px;
    background-color: #4b5563;
    margin-left: 15px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.step-connector.top-completed {
    background-color: #10b981;
}

.step-connector.both-completed {
    background-color: #10b981;
}

/* Responsive: On mobile, make stepper horizontal */
@media (max-width: 768px) {
    .stepper-container {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }
    
    .step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }
    
    .step-content {
        padding-bottom: 0;
    }
    
    .step-connector {
        width: 40px;
        height: 2px;
        margin-left: 0;
        margin-top: 16px;
    }
    
    .step-circle {
        width: 28px;
        height: 28px;
    }
    
    .step-desc {
        display: none;
    }
}

/* Sticky sidebar */
.sticky-top {
    position: sticky;
    top: 2rem;
}

/* Custom scrollbar for solutions panel */
.max-h-96::-webkit-scrollbar {
    width: 6px;
}

.max-h-96::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

.max-h-96::-webkit-scrollbar-thumb {
    background: #ef4444;
    border-radius: 4px;
}

.max-h-96::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Additional styling for solution boxes */
.bg-gray-800[style*="border-top: 4px solid #10b981"] {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.bg-gray-800[style*="border-top: 4px solid #f97316"] {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

/* Make sure the border radius works properly */
.rounded-xl {
    border-radius: 0.75rem;
}

/* ============================================
   INCREASED FONT SIZES - BOTH PAGES
   ============================================ */

/* Solution names and descriptions (checkbox items) */
.space-y-2 label .font-medium,
.bg-gray-700 label .font-medium {
    font-size: 1.25rem !important;
}

/* Solution descriptions */
.space-y-2 label .text-xs,
.bg-gray-700 label .text-xs {
    font-size: 0.875rem !important;
}

/* Solution prices */
.text-green-400.text-sm,
.text-orange-400.text-sm {
    font-size: 1rem !important;
}

/* ECU Configuration Dropdowns - selected value */
.dropdown-selected span,
.dropdown-selected .text-white.text-sm {
    font-size: 1.25rem !important;
}

/* ECU Configuration Dropdowns - labels */
label.block.text-xs.font-medium {
    font-size: 0.875rem !important;
}

/* ECU Configuration Dropdowns - options in dropdown */
.dropdown-option span {
    font-size: 1.25rem !important;
}

/* Select dropdowns (brand and model) */
select option,
select {
    font-size: 1.25rem !important;
}

/* Section headers */
h2.text-xl,
h3.text-xl {
    font-size: 1.75rem !important;
}

h2.text-x3 {
    font-size: 2rem
}

/* Right panel headers */
.bg-gray-800 h3.text-xl {
    font-size: 1.375rem !important;
}

/* Customer info form labels and inputs */
input[type="text"],
input[type="email"],
input,
select {
    font-size: 0.9375rem !important;
}

/* Customer info labels */
.bg-gray-800 label.block.text-sm {
    font-size: 0.9375rem !important;
}

/* Total price */
.text-2xl.font-bold.text-orange-500 {
    font-size: 1.75rem !important;
}

/* Total label */
.flex.justify-between .text-base.font-semibold {
    font-size: 1.125rem !important;
}

/* Submit button */
button[type="submit"] {
    font-size: 1rem !important;
}

/* File upload text */
#dropzone p.text-sm {
    font-size: 0.9375rem !important;
}

/* Remove file button */
button.text-red-400.text-sm {
    font-size: 0.875rem !important;
}

/* Car model/engine input labels */
.grid.grid-cols-2 label.block.text-xs {
    font-size: 0.875rem !important;
}

/* Car model/engine input placeholder text */
input::placeholder {
    font-size: 0.875rem !important;
}

/* Navigation menu links */
nav a, .bg-gray-800 a {
    font-size: 0.9375rem !important;
}

/* Banner title */
h1.text-xl.md\:text-2xl {
    font-size: 1.5rem !important;
}
@media (min-width: 768px) {
    h1.text-xl.md\:text-2xl {
        font-size: 1.75rem !important;
    }
}

/* Index page subtitle */
.text-center p.text-gray-400 {
    font-size: 1rem !important;
}

/* Index page "Select Service" heading */
.text-center h2.text-2xl.md\:text-3xl {
    font-size: 1.75rem !important;
}
@media (min-width: 768px) {
    .text-center h2.text-2xl.md\:text-3xl {
        font-size: 2rem !important;
    }
}

/* ============================================
   5-STEP PROGRESS BAR
   ============================================ */

.progress-container {
    background-color: rgba(31, 41, 55, 0.5);
    border-bottom: 1px solid #374151;
    padding: 1rem 0;
}

.progress-wrapper {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
}

.stepper-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    position: relative;
    margin: 0;
    padding: 0;
}

.step-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.step-circle-5 {
    width: 36px;
    height: 36px;
    background-color: #6b7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 2;
    position: relative;
    font-size: 1rem;
    font-weight: bold;
    color: white;
}

.step-circle-5.completed {
    background-color: #28a745;
}

.step-circle-5 .step-symbol {
    display: inline-block;
    animation: fadeScale 0.3s ease;
}

.step-label-5 {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #e8e8e8;
    text-align: center;
    max-width: 100px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

/* Connector lines between steps */
.step-5:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background-color: #6b7280;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.step-5.line-green::after {
    background-color: #28a745;
}

@keyframes fadeScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .step-circle-5 {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
    
    .step-label-5 {
        font-size: 0.625rem;
        max-width: 70px;
    }
    
    .step-5:not(:last-child)::after {
        top: 14px;
        height: 2px;
    }
}

@media (max-width: 480px) {
    .step-label-5 {
        font-size: 0.5rem;
        max-width: 55px;
    }
    
    .step-circle-5 {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .step-5:not(:last-child)::after {
        top: 12px;
    }
}

.step-circle-5:focus-visible {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Animated gradient text */
.animated-gradient {
    background: linear-gradient(270deg, #ffffff, #ff0000, #ffffff);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
    font-weight: bold;
    font-size: 18px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Help Contact Box */
.help-contact-box {
    background-color: #c1b770;
    border: 1px solid #000000;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.help-contact-box p {
    color: #000000;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.help-contact-box a {
    color: #000000;
    text-decoration: underline;
    font-weight: 600;
}

.help-contact-box a:hover {
    color: #dc2626;
    text-decoration: none;
}

@media (max-width: 768px) {
    .help-contact-box p {
        font-size: 0.875rem;
    }
}

/* Success Button Box */
.success-button-box {
    margin-bottom: 1rem;
}

/* Success Button - SINGLE DEFINITION */
.success-button {
    width: 100%;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    white-space: normal;
    min-height: auto;
}

.success-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.success-check {
    background-color: white;
    color: #059669;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.success-button-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.success-button-clicked {
    background-color: #15803d !important;
    opacity: 0.8;
    cursor: default;
    animation: none !important;
}

.success-button-clicked:hover {
    transform: none;
}

@media (max-width: 768px) {
    .success-button {
        font-size: 1rem;
        padding: 0.875rem;
        line-height: 1.4;
    }
    .success-check {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

/* Tailwind color overrides */
.bg-green-600 { background-color: #16a34a; }
.bg-green-700 { background-color: #15803d; }
.bg-green-800 { background-color: #166534; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-green-900:hover { background-color: #14532d; }

/* Bullet items */
.bullet-top {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e7eb;
    line-height: 1.3;
}

.bullet-bottom {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}

.bullet-marker {
    color: #fbbf24;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.flex-items-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.bullet-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #dc2626;
    text-align: center;
    width: 250px;
}

/* Three Button Cards */
.card-button {
    position: relative;
    border-radius: 0.75rem;
    border: 8px solid #dc2626;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    height: 100%;
}

.card-button:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.card-button-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-button-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem 0.1rem 1rem;
    text-align: center;
}

.card-button-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.1rem;
}

.card-button-description {
    font-size: 1rem;
    color: #e5e7eb;
}

.card-button-hint {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #fbbf24;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-button:hover .card-button-hint {
    opacity: 1;
}

/* Force headers to be full width and centered */
.mt-4.mb-4 {
    width: 100%;
    display: block;
    text-align: center;
    clear: both;
}

.mt-4.mb-4 h3 {
    text-align: center !important;
    display: block;
    width: 100%;
}

/* Marquee Section Styles */
.marquee-section {
    width: 100%;
    background-color: #dc2626;
    padding: 0.75rem 0;
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: scrollMarquee 20s linear infinite;
    white-space: nowrap;
}

.marquee-text {
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.marquee-section:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.33%); }
}

@media (max-width: 768px) {
    .marquee-text {
        font-size: 0.85rem;
        padding: 0 1rem;
    }
    .marquee-section {
        padding: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .marquee-text {
        font-size: 0.7rem;
        padding: 0 0.75rem;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.marquee-section {
    margin-top: auto;
}

/* ECU Files Search Page Styles */
.search-result-row:hover {
    background-color: rgba(239, 68, 68, 0.1);
    cursor: pointer;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.pagination-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.results-table th {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.part-number-cell {
    font-family: monospace;
    font-weight: 500;
}

.selected-part-row {
    background-color: rgba(239, 68, 68, 0.2);
    border-left: 3px solid #ef4444;
}

/* Selected part summary box */
.selected-part-summary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.selected-part-summary h3 {
    color: #f59e0b;
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.selected-part-summary .part-number {
    color: #fbbf24;
    font-family: monospace;
    font-weight: bold;
    font-size: 1rem;
}

/* Green border for dropzone when search is valid */
#dropzone.search-valid {
    border-color: #28a745 !important;
    border-width: 2px !important;
    background-color: rgba(40, 167, 69, 0.05) !important;
}

/* Background for entire page */
body {
    background-image: url('/static/core/images/background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.30);
    z-index: -1;
    pointer-events: none;
}

/* Keep modal backgrounds solid */
#modal .bg-gray-800 {
    background-color: rgb(31, 41, 55) !important;
}

/* Dropzone styles */
#dropzone.search-valid {
    border-color: #28a745 !important;
    border-width: 2px !important;
    background-color: rgba(40, 167, 69, 0.05) !important;
}

.sticky {
    position: sticky;
    top: 0;
    z-index: 10;
}
