/* Mobile-Responsive and Enhanced UI Styles */

/* Smooth animations */
* {
    transition: all 0.3s ease;
}

/* Mobile-first responsive utilities */
@media (max-width: 768px) {
    /* Make containers full width on mobile */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Stack grid items on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Adjust card padding */
    .card {
        padding: 1rem !important;
    }
    
    /* Make tables scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Better form inputs on mobile */
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Stack buttons vertically */
    .button-group {
        flex-direction: column !important;
    }
    
    .button-group button {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    /* Adjust dashboard stats */
    .stat-card {
        min-width: 100% !important;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Improve navigation */
    .nav-item {
        padding: 0.75rem 1rem !important;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Enhanced card styles */
.card-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Glassmorphism effect for modern cards */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #667eea;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Success/Error animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(400px); }
    to { transform: translateX(0); }
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

/* Customer story popup */
.customer-story-popup {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 22rem;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.customer-story-popup.hidden {
    display: none;
}

.customer-story-image {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: 9999px;
    object-fit: cover;
}

.customer-story-close {
    position: absolute;
    top: 0.2rem;
    right: 0.45rem;
    color: #6b7280;
    font-size: 1.25rem;
    line-height: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Accessibility improvements */
:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    input, select, textarea {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
