/* Mobile responsive styles for the account page */

@media screen and (max-width: 768px) {    /* Adjust layout for mobile */
    .modern-account-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }    /* Use CSS custom properties to manage header height */
    :root {
        --mobile-header-height: 70px;
        --mobile-nav-height: 60px;
    }

    /* Split sidebar into header and nav */
    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        padding: 0;
        border-right: none;
        border-bottom: none;
        display: block;
        background: transparent;
    }
      /* Make the logo area a fixed header */
    .sidebar-logo {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 101;
        background: var(--card-bg, #ffffff);
        transition: box-shadow 0.3s ease;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        height: var(--mobile-header-height);
        width: 100%;
    }
    
    /* Logo should only take its needed width */
    .sidebar-logo .logo-link {
        flex: 0 0 auto;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Mobile page title */
    .mobile-page-title {
        display: none;
    }
    
    /* Only show on mobile */
    .mobile-only {
        display: none;
    }
    
    @media screen and (max-width: 768px) {
        .mobile-only {
            display: block;
        }
        
        .mobile-page-title {
            display: block;
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
            text-align: center;
            flex-grow: 1;
            position: absolute;
            left: 50%;
            transform: translateX(-18%);
        }
        
        .sidebar-logo .back-arrow {
            color: var(--text-color);
            font-size: 1.7rem;
            text-decoration: none;
            z-index: 2;
        }
        
        .sidebar-logo .logo-link {
            display: none;
        }
    }/* Navigation as a fixed element below header */
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        top: var(--mobile-header-height);
        left: 0;
        right: 0;
        z-index: 100;
        justify-content: flex-start;
        width: 100%;
        margin-top: 0;
        margin-bottom: 1rem;
        background: var(--card-bg, #ffffff);
        border-bottom: 1px solid var(--border-color);
        scrollbar-width: none; /* Hide scrollbar for Firefox */
        height: var(--mobile-nav-height);
        box-sizing: border-box;
    }
    
    /* Hide scrollbars for Chrome and Safari */
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }.sidebar-link {
        flex-shrink: 0;
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        border-radius: 4px;
        background: transparent;
        border: none;
        white-space: nowrap;
        position: relative;
        transition: all 0.2s ease;
    }

    .sidebar-link.active {
        background: rgba(124, 58, 237, 0.1);
        color: var(--primary-color, #7C3AED);
        font-weight: 500;
    }
    
    .sidebar-link::after {
        content: '';
        position: absolute;
        bottom: -0.5rem;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: var(--primary-color, #7C3AED);
        opacity: 0;
        transform: scaleX(0.5);
        transition: all 0.3s ease;
    }
    
    .sidebar-link.active::after {
        opacity: 1;
        transform: scaleX(1);
    }

    .sidebar-link i {
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }.sidebar-footer {
        display: none; /* Hide footer on mobile */
    }    
    
    .mobile-avatar {
        width: 34px;
        height: 34px;
        margin-right: 0;
    }
    
    /* Touch interactions */
    .touch-active {
        transform: scale(0.97);
        opacity: 0.9;
        transition: transform 0.1s ease, opacity 0.1s ease;
    }

    .touch-highlight {
        background-color: rgba(245, 245, 245, 0.8) !important;
        transition: background-color 0.1s ease;
    }    /* Main content adjustments */
    .account-main {
        padding: 1rem;
        padding-top: calc(var(--mobile-header-height) + var(--mobile-nav-height) + 3rem);
        margin-top: 0;
        position: relative;
        z-index: 1; /* Lower than header/nav */
        transition: padding-top 0.3s ease; /* Smooth transition when nav height changes */
    }    /* Add spacer to create visual gap after fixed nav */
    .account-main::before {
        content: '';
        display: block;
        height: 20px;
        margin-bottom: 1.5rem;
    }
    .account-section h1 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
        margin-top: 1.5rem;
        padding-bottom: 0.5rem;
    }

    /* Add extra spacing for the first section */
    .account-section:first-of-type {
        padding-top: 1.5rem;
    }

    /* Credits card adjustments */
    .credits-card {
        padding: 1.25rem;
    }

    .credits-balance {
        font-size: 2.2rem;
    }    /* Pricing plans adjustments - horizontal scrolling row */
    .pricing-plans {
        display: flex !important; /* Force flex display for mobile */
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        margin: 0 -1rem;
        padding: 1rem;
        width: calc(100% + 2rem);
    }
      
    .pricing-card {
        flex: 0 0 85%;
        min-width: 260px;
        max-width: 290px;
        padding: 1.25rem;
        margin-bottom: 0.5rem;
        scroll-snap-align: start;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* Make pricing card elements more compact */
    .pricing-card-header {
        margin-bottom: 1rem;
    }
    
    .pricing-card-title {
        font-size: 1.5rem;
    }
    
    .pricing-card-price {
        font-size: 1.8rem;
    }
    
    .pricing-card-credits {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        padding: 0.4rem 0.6rem;
    }
    
    .pricing-card-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .pricing-card-features {
        margin-bottom: 1.2rem;
    }
    
    .pricing-card-features li {
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Add visual indicator for horizontal scrolling */
    .pricing-plans:after {
        content: '';
        flex: 0 0 1rem;
    }

    .pricing-card-title {
        font-size: 1.75rem;
    }

    .pricing-card-price {
        font-size: 1.8rem;
    }

    .pricing-card-credits {
        font-size: 1.25rem;
    }

    /* Payment section adjustments */
    #payment-section {
        padding: 1.25rem;
    }

    /* Transactions table adjustments */
    .transactions-table-container {
        overflow-x: auto;
        width: calc(103% + 2rem);
        -webkit-overflow-scrolling: touch;
    }

 

    .transactions-table th,
    .transactions-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }    /* Fix dropdown positioning */
    .dropdown-menu {
        right: 0;
        top: 100%;
        width: 250px; 
        left: auto;
        position: absolute;
        max-height: calc(90vh - 60px);
        overflow-y: auto;
    }
      /* Add mobile header user menu */
    .mobile-header-menu {
        position: relative;
    }
      /* Position dropdown for mobile header */
    .mobile-header-menu .dropdown-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 10px);
        width: 250px;
        z-index: 1010;
        max-height: calc(80vh - 60px);
        overflow-y: auto;
    }
    
    /* Style dropdown header for mobile */
    .mobile-header-menu .dropdown-header {
        padding: 1rem;
        display: flex;
        align-items: center;
        background: rgba(245, 245, 245, 0.3);
        border-bottom: 1px solid var(--border-color, #e0e0e0);
    }
    
    .mobile-header-menu .dropdown-header img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 0.75rem;
        border: 1px solid var(--border-color, #e0e0e0);
        object-fit: cover;
    }
    
    .mobile-header-menu .dropdown-user-info {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-header-menu .user-display-name {
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-color, #333);
    }
    
    .mobile-header-menu .user-email {
        font-size: 0.8rem;
        color: var(--text-color-secondary, #666);
        margin-top: 2px;
    }
    
    .mobile-header-menu .dropdown-item {
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        border: none;
        background: transparent;
        width: 100%;
        text-align: left;
        cursor: pointer;
        color: var(--text-color, #333);
        font-size: 0.9rem;
    }
    
    .mobile-header-menu .dropdown-item:hover {
        background: rgba(245, 245, 245, 0.5);
    }
    
    .mobile-header-menu .dropdown-item i {
        margin-right: 0.75rem;
        font-size: 0.9rem;
        opacity: 0.85;
    }
    
    .mobile-header-menu .dropdown-divider {
        height: 1px;
        background: var(--border-color, #e0e0e0);
        margin: 0;
    }
    
    #auth-section {
        height: auto;
    }

    /* Section header adjustments */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #back-to-plans-container {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* PayPal button container */
    .paypal-button-container {
        max-width: 100%;
    }    /* Mobile active indicator for sidebar */
    .mobile-active-indicator {
        display: block;
        height: 2px;
        bottom: 0;
        background-color: var(--primary-color, #7C3AED);
        position: absolute;
        transition: all 0.3s ease;
    }
    
  

    /* Scrollable area fix for iOS momentum scrolling */
    .transactions-table-container,
    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
    }

    /* Loading and UI indicators optimized for touch */
    .loading-spinner {
        transform: scale(0.8);
    }    /* Auth modal adjustments */
    .auth-modal {
        padding: 1rem;
    }
    
    .auth-card {
        width: 90%;
        max-width: 320px;
    }
      
    #mobile-login-btn.hidden {
      display: none !important;
    }
    }
      /* Additional rule to ensure hidden elements stay hidden */
      /* Enhanced fixed header styles for mobile */
    .sidebar-logo.scrolled,
    .sidebar-nav.scrolled {
        background-color: var(--card-bg-color, #fff);
    }
  
    /* Proper dark mode support for fixed header */
    .dark-mode .sidebar-logo,
    .dark-mode .sidebar-nav {
        background: var(--card-background, #1e1e1e);
        border-color: var(--border-color, #333);
    }

    .dark-mode .sidebar-logo.scrolled,
    .dark-mode .sidebar-nav.scrolled {
        box-shadow: 0 2px 8px rgba(0, 0, 0, calc(0.2 * var(--shadow-opacity, 1)));
    }    /* Improved transition for smooth UI experience */
    .sidebar-logo,
    .sidebar-nav {
        transition: box-shadow 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
        will-change: box-shadow; /* Performance optimization for shadow animations */
    }/* Add visual separation under fixed header */
    .account-section {
        position: relative;
    }

/* Hide mobile specific elements on desktop views (screens larger than 768px) */
@media screen and (min-width: 769px) {
}

/* Fix for iOS devices */
@supports (-webkit-touch-callout: none) {
    /* iOS specific fixes can stay here if needed */
}

/* Transaction History Mobile Styles */
@media screen and (max-width: 768px) {
    /* Card-based transaction history for mobile */
    .transactions-table {
        display: block;
        border: none;
        background: transparent;
    }

   

    .transactions-container {
        width: 100%;
        padding: 0;
    }
    
    .transactions-table thead {
        display: none; /* Hide table headers on mobile */
    }
    
    .transactions-table tbody {
        display: block;
        width: 100%;
    }    .transactions-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color, #e0e0e0);
        border-radius: 8px;
        background: var(--card-bg-color, #fff);
        padding: 1rem;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        position: relative;
        overflow: hidden;
    }
    
    .transactions-table tbody tr:active {
        transform: scale(0.98);
    }
    
    .transactions-table td {
        display: flex;
        padding: 0.5rem 0;
        border: none;
        text-align: left;
        font-size: 0.9rem;
        align-items: center;
    }
    
    /* Add label before content for each cell */
    .transactions-table td:nth-of-type(1):before {
        content: "Date: ";
        font-weight: 600;
        min-width: 80px;
        display: inline-block;
    }
    
    .transactions-table td:nth-of-type(2):before {
        content: "Type: ";
        font-weight: 600;
        min-width: 80px;
        display: inline-block;
    }
    
    .transactions-table td:nth-of-type(3):before {
        content: "Description: ";
        font-weight: 600;
        min-width: 80px;
        display: inline-block;
    }
    
    .transactions-table td:nth-of-type(4):before {
        content: "Amount: ";
        font-weight: 600;
        min-width: 80px;
        display: inline-block;
    }    /* Enhance transaction type badges */
    .transaction-type {
        margin-left: 0;
        padding: 0.3rem 0.7rem;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 500;
        text-transform: capitalize;
    }
    
    /* Enhance transaction amounts on mobile */
    .transaction-amount {
        font-weight: 700;
        font-size: 1rem;
    }
    
    /* Update date format for better mobile display */
    .transaction-date {
        font-size: 0.85rem;
        opacity: 0.9;
    }
    
    /* Fix overflow issues */
    .transactions-table-container {
        overflow-x: hidden;
    }
      /* Empty state styling for mobile */
    .empty-state {
        padding: 2rem 1rem;
        text-align: center;
        background: var(--card-bg-color, #fff);
        border-radius: 8px;
        border: 1px solid var(--border-color, #e0e0e0);
        margin: 1rem 0;
    }
    
    .empty-state i {
        font-size: 2.5rem;
        color: var(--text-color-secondary, #666);
        margin-bottom: 1rem;
        opacity: 0.5;
    }
    
    .empty-state p {
        color: var(--text-color-secondary, #666);
        font-size: 0.95rem;
        margin: 0;
    }
    
    .dark-mode .empty-state {
        background: var(--card-background, #1e1e1e);
        border-color: var(--border-color, #333);
    }
    
    .dark-mode .empty-state i,
    .dark-mode .empty-state p {
        color: var(--muted-text, #aaa);
    }
    
    /* Add animation for transaction cards loading */    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Add staggered animation for transaction items */
    .transactions-table tbody tr {
        animation: fadeInUp 0.3s ease forwards;
        animation-delay: calc(var(--animation-order, 0) * 0.05s);
        opacity: 0;
    }
    
    /* Improve empty state for transactions */
    .empty-state {
        animation: fadeInUp 0.3s ease forwards;
        padding: 2.5rem 1rem;
    }
      /* Dark mode transaction cards */
    .dark-mode .transactions-table tbody tr {
        background: var(--card-background, #1e1e1e);
        border-color: var(--border-color, #333);
    }
    
    .dark-mode .transactions-table td:before {
        color: var(--muted-text, #aaa);
    }
    
    .dark-mode .transaction-amount {
        color: var(--text-color, #fff);
    }
    
    .dark-mode .transaction-amount.positive {
        color: var(--success-color, #4CAF50);
    }
    
    .dark-mode .transaction-amount.negative {
        color: var(--danger-color, #f44336);
    }
    
    .dark-mode .transaction-date {
        color: var(--muted-text, #aaa);
    }
}


/* Transaction section title - prevent header overlap */
#section-transactions h1 {
    position: relative;
    z-index: 1;
    padding-bottom: 1rem;
}

/* Tablet view (between mobile and desktop) */
@media screen and (min-width: 600px) and (max-width: 768px) {
    /* Two-column card layout for transactions on tablets */
    .transactions-table tbody {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Make each card take up a bit less space */
    .transactions-table tbody tr {
        margin-bottom: 0;
    }
    
    /* Adjust padding for tablet cards */
    .transactions-table td {
        padding: 0.4rem 0;
    }
    
    /* Slightly smaller labels on tablet */
    .transactions-table td:before {
        min-width: 70px;
        font-size: 0.85rem;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .pricing-card-features li {
        font-size: 0.8rem;
    }

    .pricing-card-price {
        font-size: 1.6rem;
    }

    .credits-balance {
        font-size: 1.8rem;
    }

    .account-section h1 {
        font-size: 1.3rem !important;
    }

    .select-package-btn {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
      /* Additional transaction adjustments for very small screens */
    .transactions-table td:before {
        min-width: 70px;
        font-size: 0.8rem;
    }
    
    .transactions-table td {
        font-size: 0.85rem;
        padding: 0.35rem 0;
    }
    
    /* Compact the card layout even more */
    .transactions-table tbody tr {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    /* Make transaction type badges more compact */
    .transaction-type {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }    /* Stack the transaction history header on small devices */
    #section-transactions h1 {
        margin-bottom: 0.8rem;
        padding-top: 1rem;
        font-weight: 600;
    }
    
    /* Fix for very small screens */
    html {
        font-size: 15px;
    }
}

/* Add scroll padding to safely account for fixed header when navigating between sections */
html {
    scroll-padding-top: calc(var(--mobile-header-height) + var(--mobile-nav-height) + 1.5rem);
}

/* Make it clear that the plan card itself is not clickable on mobile */
@media screen and (max-width: 768px) {
    .pricing-card {
        pointer-events: none; /* Disable click events on the card on mobile only */
        cursor: default;
    }
    
    /* But allow clicking on the button on mobile */
    .pricing-card .select-package-btn {
        pointer-events: auto; /* Re-enable click events on buttons */
        cursor: pointer;
    }
    
    /* Add visual feedback when tapping on mobile */
    .pricing-card .select-package-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Add class for mobile view mode to avoid CSS specificity issues */
.pricing-plans.mobile-view .pricing-card {
    pointer-events: none;
    cursor: default;
}

.pricing-plans.mobile-view .pricing-card .select-package-btn {
    pointer-events: auto;
    cursor: pointer;
}
