/* app.css - Additional App Styles */

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-screen .logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.splash-screen .brand {
    font-size: 24px;
    font-weight: 700;
    color: #0F766E;
}

.splash-screen .loader {
    margin-top: 30px;
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top: 4px solid #0F766E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 480px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateX(-50%) translateY(0);
}

.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 0 auto 16px;
}

/* Pull to Refresh */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    transform: translateY(-60px);
    transition: transform 0.3s ease;
    z-index: 99;
}

.pull-to-refresh.active {
    transform: translateY(0);
}

.pull-to-refresh .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Badge Styles */
.badge-primary {
    background: var(--primary);
    color: var(--white);
}

.badge-accent {
    background: var(--accent);
    color: var(--white);
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-error {
    background: var(--error);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--white);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Product Card Variations */
.product-card-horizontal {
    display: flex;
    gap: 16px;
}

.product-card-horizontal .image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
}

.product-card-horizontal .info {
    flex: 1;
}

/* Supplier Card */
.supplier-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.supplier-card .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.supplier-card .info {
    flex: 1;
}

.supplier-card .badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

/* Filter Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--background);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip.active {
    background: var(--primary);
    color: var(--white);
}

.chip .remove {
    cursor: pointer;
    opacity: 0.6;
}

.chip .remove:hover {
    opacity: 1;
}

/* Loading States */
.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: dotBounce 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Toast Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .product-card-horizontal .image {
        width: 80px;
        height: 80px;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    
    .grid-cols-4 {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 6px;
    }
}

@media (max-width: 380px) {
    .grid-cols-4 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Desktop Specific */
@media (min-width: 1024px) {
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
    }
    
    .grid-cols-4 {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .skeleton {
        animation: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chip {
        background: var(--white);
        color: var(--text-secondary);
    }
    
    .splash-screen {
        background: var(--background);
    }
    
    .splash-screen .brand {
        color: var(--primary-light);
    }
}