/**
 * Mobile Common CSS - The Silicon Tree
 * Mobile-specific styles shared across all pages
 * Updated: December 2024
 */

/*--------------------------------------------------------------
# Mobile Styles (768px and below)
--------------------------------------------------------------*/
@media (max-width: 768px) {
    /* Hide saved items nav in mobile */
    #saved-count {
        display: none !important;
    }

    /* Navigation Styles */
    nav {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: hsl(var(--background));
        border-bottom: 1px solid hsl(var(--border));
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        background:transparent;
        backdrop-filter:saturate(120%) blur(8px);
    }
    .nav-links {
        display: none;
    }
    .nav-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        height: 3rem;
        padding: 0 0.5rem;
        margin-right: 0;
        justify-content: space-between;
    }
    
    .logo {
        justify-self: start;
        margin-left: 0;
    }
    
    .logo img {
        max-height: 35px;
        width: auto;
    }
    div#page-title-placeholder {
        display: flex !important;
        justify-self: center;
        align-items: center;
        gap: 0.25rem;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        background: hsl(var(--background));
        background:transparent;
        border-bottom: 1px solid hsl(var(--border));
        max-width: 100%;
        overflow: hidden;
    }
    
    .page-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: hsl(var(--foreground));
        padding: 0 0.25rem 0 0;
        margin-bottom: 0.25rem;
        text-align: center;
      }
    
    .page-title-placeholder {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        background: hsl(var(--background));
        border-bottom: 1px solid hsl(var(--border));
    }
    
    .mobile-saved-count {
        display: flex;
        gap: 0.25rem;
        padding: 0 0.5rem;
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        background: hsl(var(--muted));
        font-size: 0.75rem;
        text-decoration: none;
    }

    .mobile-saved-count.active {
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
        border-color: hsl(var(--primary));
    }

    .saved-count-badge, .count-badge {
        background: hsl(var(--primary));
        padding: 0.125rem 0.5rem;
        border-radius: 1rem;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .saved-items-section{
        display: none;
    }
    
    .mobile-saved-count i {
        font-size: 0.875rem;
        color: hsl(var(--primary));
    }
    
    .mobile-saved-count .count-badge {
        font-weight: 500;
    }

    .saved-count {
        background-color: hsl(var(--background));
    }
    
    .mobile-menu {
        display: block;
        order: 3;
        justify-self: end;
        margin-right: 0;
        position: relative;
    }
    
    .mobile-back-btn {
        width: 2.5rem;
        height: 2.5rem;
        background: transparent;
        border: 0px;
        color: hsl(var(--foreground));
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    
    .mobile-back-btn:hover {
        background: hsl(var(--muted));
    }
    
    .mobile-back-btn i {
        font-size: 1.25rem;
    }
    
    .mobile-menu-toggle {
        width: 2.5rem;
        height: 2.5rem;
        background: transparent;
        border: 0px;
    }
    
    .mobile-menu-toggle:hover {
        background: hsl(var(--muted));
        border-color: hsl(var(--muted-foreground));
    }
    
    .mobile-menu-toggle i {
        font-size: 1.25rem;
    }
    
    .mobile-menu-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: hsl(var(--background));
        border: 1px solid hsl(var(--border));
        border-top: none;
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: none;
        flex-direction: column;
        padding: 0.5rem 0;
        width:15rem;
    }
    
    .mobile-menu-dropdown.show {
        display: flex;
    }
    
    .mobile-menu-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        color: hsl(var(--foreground));
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid hsl(var(--border));
    }
    
    .mobile-menu-link:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-link:hover {
        background: hsl(var(--muted));
        color: hsl(var(--primary));
    }
    
    .mobile-menu-link i {
        font-size: 1.125rem;
        width: 1.25rem;
        text-align: center;
    }
    
    .mobile-menu-link.active {
        color: hsl(var(--primary));
    }
    
    .mobile-menu-link.active:hover {
        color: hsl(var(--primary));
    }
    
    /* Mobile Dropdown Styles */
    .mobile-dropdown {
        position: relative;
    }
    
    .mobile-dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .mobile-dropdown-toggle i:last-child {
        font-size: 0.75rem;
        transition: transform 0.3s ease;
    }
    
    .mobile-dropdown.active .mobile-dropdown-toggle i:last-child {
        transform: rotate(180deg);
    }
    
    .mobile-dropdown-menu {
        display: none;
        flex-direction: column;
        background: hsl(var(--muted));
        border-left: 3px solid hsl(var(--primary));
        margin-left: 1rem;
    }
    
    .mobile-dropdown.active .mobile-dropdown-menu {
        display: flex;
    }
    
    .mobile-dropdown-item {
        padding-left: 2rem;
        font-size: 0.875rem;
        color: hsl(var(--muted-foreground));
    }
    
    .mobile-dropdown-item:hover {
        background: hsl(var(--background));
        color: hsl(var(--primary));
    }
    
    .mobile-dropdown-item.active {
        color: hsl(var(--primary));
        background: none;
        font-weight: 500;
    }
    
    .mobile-dropdown-item.active:hover {
        background: hsl(var(--background));
        color: hsl(var(--primary));
    }
    /* Page Header Styles */
    .page-header {
        padding: 0.5rem 0;
        margin-bottom: 0;
    }

    .page-header-left {
        flex: 1;
    }
    
    .page-header-right {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .page-header .page-title,
    .page-header .saved-count{
        display: none;
    }
    
    .page-description {
        color: hsl(var(--muted-foreground));
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .saved-items-section {
        margin-top: 1rem;
    }
    /* Form Styles */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        display: block;
        font-weight: 500;
        margin-bottom: 0.5rem;
        color: hsl(var(--foreground));
    }
    
    .form-control {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        background: hsl(var(--background));
        color: hsl(var(--foreground));
        font-size: 1rem;
        transition: all 0.2s ease;
    }
    
    .form-control:focus {
        outline: none;
        border-color: hsl(var(--primary));
        box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
    }
    
    .form-control::placeholder {
        color: hsl(var(--muted-foreground));
    }
    /* Footer Styles */
    footer {
        padding: 0.5rem 0.5rem 0.5rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        display: flex;
        flex-direction: column;
        padding: 0 0.5rem;
    }
    
    .footer-brand{
        display: none;
    }
    .footer-left {
        order: 2;
        width:100%;
    }
    
    .footer-right {
        order: 1;
        padding: 0.5rem;
    }
    
    .footer-brand {
        justify-content: center;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    /* Strategy 2: Icon-Only Footer Links (Primary) */
    .footer-links {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
        order: 3;
        overflow: visible;
        gap: 0.75rem;
    }
    
    .footer-link {
        justify-content: center;
        width: 48px;
        height: 48px;
        background: rgba(255, 255, 255, 0.1);

        flex: 1;

        border-radius: 0.625rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        gap: 0rem;
    }
    
    .footer-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .footer-link:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    /* Hide text, show only icons */
    .footer-link {
        font-size: 0;
    }
    
    .footer-link *:not(i) {
        display: none;
    }
    
    /* Style icons */
    .footer-link i {
        font-size: 1.5rem;
        margin: 0;
        color: #ffffff;
    }
    
    /* Tooltip on hover/focus */
    .footer-link:hover::before,
    .footer-link:focus::before {
        content: attr(data-label);
        position: absolute;
        bottom: -2.5rem;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
        z-index: 1000;
        pointer-events: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        animation: fadeInUp 0.2s ease-out;
    }
    .footer-copyright {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    .footer-copyright-text {
        font-size: 0.75rem;
      }
    
    /* Arrow pointing up to tooltip */
    .footer-link:hover::after,
    .footer-link:focus::after {
        content: '';
        position: absolute;
        bottom: -2rem;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-bottom-color: rgba(0, 0, 0, 0.9);
        z-index: 1000;
        pointer-events: none;
    }
    
    /* Page Content Styles */
    .page-content {
        padding: 1rem 0 0.5rem 0;
    }
    .container {
        padding: 0 0.35rem;
    }
}

/*--------------------------------------------------------------
# Mobile Styles (640px and below)
--------------------------------------------------------------*/
@media (max-width: 640px) {
    .notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

/*--------------------------------------------------------------
# Mobile Styles (480px and below)
--------------------------------------------------------------*/
@media (max-width: 480px) {
    /* Ultra-compact page content */
    .page-content {
        padding: 0;
    }
    
    /* Reduce section gaps on very small screens */
    .page-content > * + * {
        margin-top: 1rem;
    }
    
    /* Larger icons for better visibility on small screens */
    .footer-link i {
        font-size: 1.75rem;
    }
    
    /* Enhanced tooltip positioning for small screens */
    .footer-link:hover::before,
    .footer-link:focus::before {
        bottom: -3rem;
        font-size: 0.8rem;
        padding: 0.625rem 1rem;
    }
    
    .footer-link:hover::after,
    .footer-link:focus::after {
        bottom: -2.5rem;
    }
    
    /* Hide scroll arrows in mobile mode - use native finger scrolling */
    .scroll-arrow {
        display: none !important;
    }
    
    /* Enable native scrolling for resource containers */
    .resource-scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Hide scrollbar but keep functionality */
    .resource-scroll-container::-webkit-scrollbar {
        display: none;
    }
    
    .resource-scroll-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    /* Resource Hub Mobile Card Layout - Show 1.2 cards */
    .resource-grid {
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .resource-card {
        flex: 0 0 calc(100vw / 1.2 - 1rem);
        min-width: calc(100vw / 1.2 - 1rem);
        max-width: calc(100vw / 1.2 - 1rem);
        min-height: 400px;
    }
    
    .resource-section:last-child {
        margin-bottom: 1rem;
    }
}

/*--------------------------------------------------------------
# Desktop Navigation Styles
--------------------------------------------------------------*/
@media (min-width: 768px) {
    /* Hide page titles in navigation on desktop */
    .nav-content .page-title {
        display: none;
    }
}

@media (min-width: 1024px) {
    .header .logo img {
        max-height: 60px;
    }
}