/**
 * Frontend CSS for Wattif Orders Plugin
 * 
 * This file contains all the styling for the customer-facing ordering system
 * including search pages, product selection, and order forms.
 */

/* Color Variables - Wattif EV Brand Colors */
:root {
    --wattif-blue-dark: rgba(16, 27, 40, 1);
    --wattif-blue: #2BAADF;
    --wattif-green: #9dd7c7;
    --wattif-green-dark: #7bc4b3;
    --wattif-green-light: #eef4f0;
    --wattif-white: #ffffff;
    --wattif-gray-light: #f8f9fa;
    --wattif-gray: #6c757d;
    --wattif-gray-dark: #495057;
    --wattif-yellow: #ffc107;
    --wattif-red: #dc3545;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--wattif-gray-dark);
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Section */
.bg-blue-dark {
    background-color: var(--wattif-blue-dark);
}

.bg-green-light {
    background-color: var(--wattif-green-light);
}

.text-green-light {
    color: var(--wattif-green);
}

.text-blue-dark {
    color: var(--wattif-blue-dark);
}

.text-green {
    color: var(--wattif-green);
}

.bg-green {
    background-color: var(--wattif-green);
}

.bg-green-dark {
    background-color: var(--wattif-green-dark);
}

.bg-blue {
    background-color: var(--wattif-blue);
}

.bg-blue-dark {
    background-color: var(--wattif-blue-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

.text-4xl {
    font-size: 2.25rem;
}

.text-5xl {
    font-size: 3rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.btn-primary {
    background-color: var(--wattif-green);
    color: var(--wattif-white);
}

.btn-primary:hover {
    background-color: var(--wattif-green-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--wattif-blue-dark);
    color: var(--wattif-white);
}

.btn-secondary:hover {
    background-color: var(--wattif-blue);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--wattif-gray-dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--wattif-green);
    box-shadow: 0 0 0 3px rgba(157, 215, 199, 0.1);
}

.form-input.error {
    border-color: var(--wattif-red);
}

.form-error {
    color: var(--wattif-red);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background-color: var(--wattif-white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background-color: var(--wattif-gray-light);
}

/* Search Results */
.search-result {
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.search-result:hover {
    border-color: var(--wattif-green);
    transform: translateY(-2px);
}

.search-result.active {
    border-color: var(--wattif-green);
    background-color: var(--wattif-green-light);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background-color: var(--wattif-green);
    color: var(--wattif-white);
}

.status-inactive {
    background-color: var(--wattif-gray);
    color: var(--wattif-white);
}

.status-pending {
    background-color: var(--wattif-yellow);
    color: var(--wattif-gray-dark);
}

.status-completed {
    background-color: var(--wattif-green);
    color: var(--wattif-white);
}

.status-cancelled {
    background-color: var(--wattif-red);
    color: var(--wattif-white);
}

/* Product Selection */
.product-option {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.product-option:hover {
    border-color: var(--wattif-green);
    transform: translateY(-2px);
}

.product-option.selected {
    border-color: var(--wattif-green);
    background-color: var(--wattif-green-light);
}

.product-option.selected .product-select-btn {
    background-color: var(--wattif-blue-dark);
    color: var(--wattif-white);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wattif-green);
}

.product-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-badge.popular {
    background-color: var(--wattif-green);
    color: var(--wattif-white);
}

.product-badge.fast {
    background-color: var(--wattif-blue);
    color: var(--wattif-white);
}

.product-badge.premium {
    background-color: var(--wattif-blue-dark);
    color: var(--wattif-white);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--wattif-white);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wattif-gray);
    padding: 0;
}

.modal-close:hover {
    color: var(--wattif-gray-dark);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--wattif-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-5xl {
        font-size: 2.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .product-option {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .text-4xl {
        font-size: 1.5rem;
    }
    
    .text-5xl {
        font-size: 1.875rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Grid System */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

/* Visibility */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Transitions */
.transition-all {
    transition: all 0.2s ease-in-out;
}

.transition-colors {
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.transition-transform {
    transition: transform 0.2s ease-in-out;
}

/* Hover Effects */
.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

/* Focus States */
.focus\:outline-none:focus {
    outline: none;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 3px rgba(157, 215, 199, 0.5);
}

.focus\:ring-green:focus {
    box-shadow: 0 0 0 3px rgba(157, 215, 199, 0.5);
}

/* Disabled States */
.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.disabled:hover {
    transform: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
