/* ============================================
   POS PRO - Main Stylesheet
   ============================================ */

/* --- Base Styles --- */
body {
    background-color: #0d1117;
    color: #c9d1d9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: #0d1117;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* --- Transitions --- */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* --- Custom Checkbox --- */
.custom-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #30363d;
    border-radius: 4px;
    background: #0d1117;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-checkbox:checked {
    background: #238636;
    border-color: #238636;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

.custom-checkbox:hover {
    border-color: #58a6ff;
}

/* --- Mobile Sidebar --- */
@media (max-width: 768px) {
    .sidebar-mobile {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar-mobile.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
    }
}

/* --- Product Cards --- */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: #58a6ff;
    box-shadow: 0 10px 40px rgba(88, 166, 255, 0.1);
}

/* --- Category Badge --- */
.category-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Stat Cards --- */
.stat-card {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    border: 1px solid #30363d;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
}

/* --- Modal Backdrop --- */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* --- Toast Notifications --- */
.toast {
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast Types */
.toast-success {
    background: linear-gradient(135deg, #238636, #2ea043);
}

.toast-error {
    background: linear-gradient(135deg, #da3633, #f85149);
}

.toast-info {
    background: linear-gradient(135deg, #58a6ff, #388bfd);
}

/* Mobile Toast */
@media (max-width: 640px) {
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

/* --- Loading Spinner --- */
.spinner {
    border: 3px solid #30363d;
    border-top: 3px solid #58a6ff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* --- Receipt Print Styles --- */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-area,
    .print-area * {
        visibility: visible;
    }
    
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
    }
}

/* --- Image Upload Preview --- */
.image-preview {
    position: relative;
    overflow: hidden;
}

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

.image-preview .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview:hover .overlay {
    opacity: 1;
}

/* --- Table Styles --- */
.data-table {
    width: 100%;
}

.data-table th {
    background: #0d1117;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background: #21262d;
}

/* --- Button Variants --- */
.btn-primary {
    background: #238636;
    color: white;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2ea043;
}

.btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #30363d;
    color: white;
}

.btn-danger {
    background: rgba(218, 54, 51, 0.1);
    color: #da3633;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #da3633;
    color: white;
}

/* --- Input Focus States --- */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* --- Cart Animation --- */
.cart-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Grid --- */
.product-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6e7681;
}

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

/* --- Login Page --- */
.login-preview {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
}

.review-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.review-card:nth-child(1) { animation-delay: 0.1s; }
.review-card:nth-child(2) { animation-delay: 0.2s; }
.review-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Registration Steps --- */
.step-indicator {
    transition: all 0.3s ease;
}

.step-active {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

/* --- User Cards --- */
.user-card {
    transition: all 0.2s ease;
}

.user-card:hover {
    background: #21262d;
}

/* --- Pending Badge Animation --- */
.pending-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- Line Clamp --- */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* --- Selection Highlight --- */
.selected-row {
    background: rgba(88, 166, 255, 0.1) !important;
}

/* --- Tooltip --- */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
}
