/**
 * WSF PWA Custom Styles
 * Additional styles for the Progressive Web App
 */

/* PWA specific styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.pwa-install-banner.show {
    transform: translateY(0);
}

/* Loading animations */
.loading-spinner {
    @apply animate-spin rounded-full border-b-2 border-primary-600;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

/* Form enhancements */
.form-group {
    @apply mb-6;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500;
}

.form-input:invalid {
    @apply border-red-300 focus:ring-red-500 focus:border-red-500;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

/* Button styles */
.btn {
    @apply px-4 py-2 border border-transparent text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors duration-200;
}

.btn-primary {
    @apply text-white bg-primary-600 hover:bg-primary-700 focus:ring-primary-500;
}

.btn-secondary {
    @apply text-primary-700 bg-primary-100 hover:bg-primary-200 focus:ring-primary-500;
}

.btn-danger {
    @apply text-white bg-red-600 hover:bg-red-700 focus:ring-red-500;
}

.btn-outline {
    @apply text-primary-600 border-primary-600 hover:bg-primary-50 focus:ring-primary-500;
}

.btn:disabled {
    @apply opacity-50 cursor-not-allowed;
}

/* Card styles */
.card {
    @apply bg-white shadow rounded-lg p-6;
}

.card-header {
    @apply border-b border-gray-200 pb-4 mb-4;
}

.card-title {
    @apply text-lg font-semibold text-gray-900;
}

.card-subtitle {
    @apply text-sm text-gray-600 mt-1;
}

/* Dashboard specific styles */
.stats-grid {
    @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8;
}

.stat-card {
    @apply bg-white p-6 rounded-lg shadow;
}

.stat-value {
    @apply text-2xl font-bold text-gray-900;
}

.stat-label {
    @apply text-sm text-gray-600 mt-1;
}

.stat-change {
    @apply text-sm font-medium mt-2;
}

.stat-change.positive {
    @apply text-green-600;
}

.stat-change.negative {
    @apply text-red-600;
}

/* Table styles */
.table-responsive {
    @apply overflow-x-auto;
}

.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table th {
    @apply px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .card {
        @apply rounded-none shadow-none border-b border-gray-200;
    }
}

/* PWA display mode styles */
@media (display-mode: standalone) {
    /* Styles when app is in standalone mode */
    body {
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Add padding for status bar on iOS */
    .ios-status-bar-padding {
        padding-top: env(safe-area-inset-top);
    }
}

/* Network status indicator */
.network-status {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    display: none;
}

.network-status.success {
    @apply bg-green-100 text-green-800 border-green-200;
}

.network-status.warning {
    @apply bg-yellow-100 text-yellow-800 border-yellow-200;
}

.network-status.error {
    @apply bg-red-100 text-red-800 border-red-200;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Focus styles for accessibility */
.focus\:ring-custom:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
    /* Currently using light mode only as specified in requirements */
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Form validation styles */
.is-valid {
    @apply border-green-300 focus:ring-green-500 focus:border-green-500;
}

.is-invalid {
    @apply border-red-300 focus:ring-red-500 focus:border-red-500;
}

/* Progress bar */
.progress {
    @apply w-full bg-gray-200 rounded-full h-2;
}

.progress-bar {
    @apply bg-primary-600 h-2 rounded-full transition-all duration-300;
}

/* Badge styles */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-primary {
    @apply bg-primary-100 text-primary-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #059669, #047857);
}

.border-dashed {
    border-style: dashed;
} 