/* Easy Savings - Custom Styles */

/* ===================================
   Goal Card Hover Animations
   =================================== */

.goal-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 
                0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Goal Card Overlay with Action Links */
.goal-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, 
                rgba(0, 0, 0, 0.95) 0%, 
                rgba(0, 0, 0, 0.85) 50%, 
                rgba(0, 0, 0, 0.4) 100%);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.25rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.goal-card:hover .goal-card-overlay {
    transform: translateY(0);
}

/* Action Link Buttons with Enhanced Transitions */
.goal-card-overlay a {
    color: white;
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.375rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.goal-card-overlay a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.goal-card-overlay a:active {
    transform: translateY(0);
}

/* ===================================
   Custom Progress Bar Styling
   =================================== */

.progress-bar {
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, 
                #3b82f6 0%, 
                #2563eb 50%, 
                #1d4ed8 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9999px;
    position: relative;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Animated shimmer effect for progress bar */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
                transparent, 
                rgba(255, 255, 255, 0.3), 
                transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===================================
   Smooth Transitions
   =================================== */

.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Hover Effects */
button,
a.btn,
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover,
a.btn:hover,
.btn:hover {
    transform: translateY(-1px);
}

button:active,
a.btn:active,
.btn:active {
    transform: translateY(0);
}

/* ===================================
   Form Input Focus States
   =================================== */

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Input animations */
input,
select,
textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ===================================
   Mobile Menu Animation
   =================================== */

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    max-height: 600px;
}

/* ===================================
   Card Animations
   =================================== */

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Loading States
   =================================== */

.loading-spinner {
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Fade In Animations
   =================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* ===================================
   Responsive Touch Targets
   =================================== */

@media (max-width: 767px) {
    /* Ensure touch-friendly button sizes on mobile */
    button,
    a.btn,
    .btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Larger tap targets for goal card action links */
    .goal-card-overlay a {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Stack action links vertically on very small screens */
    @media (max-width: 380px) {
        .goal-card-overlay {
            flex-direction: column;
            padding: 1rem;
        }
        
        .goal-card-overlay a {
            width: 100%;
            text-align: center;
        }
    }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* Screen reader only utility class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   Responsive Layout Fixes
   =================================== */

/* Prevent horizontal scrolling */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive container adjustments */
@media (max-width: 767px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    /* Hide navigation and footer when printing */
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    /* Ensure proper page breaks */
    .goal-card,
    .transaction-item {
        page-break-inside: avoid;
    }
    
    /* Remove shadows and transitions for print */
    * {
        box-shadow: none !important;
        transition: none !important;
    }
}
