/* Parafax PWA - Ana Stiller */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f1f5f9;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

/* PWA Safe Areas */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Smooth Transitions */
button, a {
    transition: all 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar for mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        display: none;
    }
    
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

.scale-in,
.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Staggered animations */
.fade-in-1 { animation: fadeIn 0.3s ease-out 0.1s both; }
.fade-in-2 { animation: fadeIn 0.3s ease-out 0.2s both; }
.fade-in-3 { animation: fadeIn 0.3s ease-out 0.3s both; }
.fade-in-4 { animation: fadeIn 0.3s ease-out 0.4s both; }

/* Glass Effect */
.glass-effect {
    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);
}

/* Gradient Classes */
.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #06b6d4 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #ea580c 100%);
}

.gradient-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #06b6d4 100%);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.card:active {
    transform: scale(0.98);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Input Styles */
.input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input::placeholder {
    color: #94a3b8;
}

/* Navigation Styles */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s ease;
    min-width: 4rem;
}

.nav-item.active {
    color: #f97316;
}

.nav-item:hover {
    color: #f97316;
}

.nav-item svg {
    transition: transform 0.3s ease;
}

.nav-item:active svg {
    transform: scale(0.9);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 3.5rem;
    height: 2rem;
    background-color: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch.active {
    background-color: #f59e0b;
}

.toggle-switch-handle {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: white;
    border-radius: 9999px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active .toggle-switch-handle {
    transform: translateX(1.5rem);
}

/* Transaction Item */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background-color: #f8fafc;
}

.transaction-item:active {
    background-color: #f1f5f9;
}

/* Account Card */
.account-card {
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.account-card::before {
    content: '';
    position: absolute;
    right: -4rem;
    top: -4rem;
    width: 8rem;
    height: 8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.account-card::after {
    content: '';
    position: absolute;
    right: -6rem;
    bottom: -6rem;
    width: 12rem;
    height: 12rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 50;
}

/* Page Content with Bottom Nav */
.page-content {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}

/* Pull to Refresh indicator */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 100;
}

.pull-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

/* Blazor specific */
#blazor-error-ui {
    display: none;
}

#blazor-error-ui.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .bottom-nav {
        max-width: 56rem;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 1rem 1rem 0 0;
        border-left: 1px solid #e2e8f0;
        border-right: 1px solid #e2e8f0;
    }
}

/* Touch feedback */
@media (hover: none) {
    .card:active,
    .btn:active,
    .nav-item:active,
    .transaction-item:active {
        opacity: 0.8;
    }
}
