/* ===== MOBILE-FIRST CSS FOR GROUPPIN ===== */
/* Mobile is PRIMARY - Desktop is enhancement */

/* ===== CSS Variables ===== */
:root {
    /* Colors - Light Mode (Default) */
    --primary-blue: #1a73e8;
    --primary-blue-hover: #1557b0;
    --primary-blue-light: rgba(26, 115, 232, 0.15);
    --secondary-purple: #8e44ad;
    --accent-green: #34a853;
    --accent-orange: #fbbc04;
    --accent-red: #ea4335;

    /* Light Mode Backgrounds & Text */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border-color: #e8eaed;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Gradients */
    --hero-gradient-start: #667eea;
    --hero-gradient-end: #764ba2;
    --fab-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Mobile Spacing */
    --mobile-padding: 16px;
    --mobile-gap: 12px;
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --fab-size: 56px;
    --touch-target: 48px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 12px;
    --font-sm: 14px;
    --font-base: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-2xl: 24px;
    --font-3xl: 28px;

    /* Z-Index Layers */
    --z-header: 100;
    --z-fab: 90;
    --z-bottom-nav: 95;
    --z-modal: 1000;
    --z-toast: 2000;

    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e8eaed;
    --text-secondary: #bdc1c6;
    --text-tertiary: #9aa0a6;
    --border-color: #3c4043;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --primary-blue-light: rgba(26, 115, 232, 0.25);
    --hero-gradient-start: #4a5568;
    --hero-gradient-end: #2d3748;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-header);
    transition: all var(--transition-base);
}

[data-theme="dark"] .mobile-header {
    background: rgba(45, 45, 45, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--mobile-padding);
}

.logo-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-lg);
    font-weight: 700;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn-mobile {
    width: var(--touch-target);
    height: var(--touch-target);
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn-mobile:active {
    transform: scale(0.9);
    background: var(--primary-blue);
}

/* Search Bar */
.search-bar-mobile {
    padding: 0 var(--mobile-padding) var(--mobile-gap);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box-mobile {
    position: relative;
}

.search-box-mobile input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 16px;
    border: 2px solid var(--border-color);
    border-radius: 22px;
    font-size: var(--font-base);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.search-box-mobile input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-secondary);
}

.search-clear-mobile {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-mobile:active {
    background: var(--bg-tertiary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

/* ===== HERO SECTION (Mobile Compact) ===== */
.hero-mobile {
    background: linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-end));
    padding: var(--mobile-padding);
    color: white;
}

.hero-content-mobile {
    text-align: center;
}

.hero-title-mobile {
    font-size: var(--font-2xl);
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}

.highlight {
    color: var(--accent-orange);
}

.hero-subtitle-mobile {
    font-size: var(--font-base);
    opacity: 0.95;
}

/* ===== FILTER CHIPS ===== */
.filter-chips {
    display: flex;
    gap: 8px;
    padding: var(--mobile-gap) var(--mobile-padding);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: var(--font-base);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: var(--touch-target);
    min-width: var(--touch-target);
}

.chip:active {
    transform: scale(0.95);
}

.chip.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

/* ===== PINS CONTAINER ===== */
.pins-container {
    padding: 0 var(--mobile-padding) var(--mobile-padding);
}

.pins-list {
    display: flex;
    flex-direction: column;
    gap: var(--mobile-gap);
}

/* Pin Card - Mobile */
.pin-card-mobile {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    animation: slideInUp var(--transition-base);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pin-card-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-blue);
}

.pin-card-mobile:active {
    transform: scale(0.98);
}

.pin-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pin-type-mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    font-size: var(--font-xs);
    font-weight: 600;
}

.pin-delete-mobile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.pin-delete-mobile:active {
    background: var(--accent-red);
    color: white;
    transform: scale(0.9);
}

.pin-title-mobile {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.pin-description-mobile {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.pin-meta-mobile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.pin-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pin-meta-item a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.pin-meta-item a:active {
    text-decoration: underline;
}

.pin-creator-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.creator-avatar-mobile {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    background: var(--fab-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-fab);
    transition: all var(--transition-base);
}

.fab:active {
    transform: scale(0.9);
}

.fab-icon {
    font-size: 32px;
    color: white;
    font-weight: 300;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-bottom-nav);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(45, 45, 45, 0.95);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: var(--font-xs);
    font-weight: 600;
}

.user-avatar-nav {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar-nav img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== BOTTOM SHEET MODAL ===== */
.bottom-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
}

.bottom-sheet.show {
    display: block;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    animation: slideUpSheet var(--transition-base);
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 12px auto 8px;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--mobile-padding) 16px;
    border-bottom: 1px solid var(--border-color);
}

.bottom-sheet-header h3 {
    font-size: var(--font-2xl);
    font-weight: 700;
}

.sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-close:active {
    background: var(--border-color);
}

/* ===== FORMS ===== */
.sheet-form {
    padding: var(--mobile-padding);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: var(--font-base);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 80px;
}

.type-option:active {
    transform: scale(0.95);
}

.type-option.selected {
    border-color: var(--primary-blue);
    background: var(--primary-blue-light);
}

.type-icon {
    font-size: 32px;
}

.type-label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.form-actions-mobile {
    margin-top: 24px;
}

.btn-primary-mobile {
    width: 100%;
    height: 52px;
    border-radius: 26px;
    border: none;
    background: var(--fab-gradient);
    color: white;
    font-size: var(--font-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary-mobile:active {
    transform: scale(0.98);
}

/* Profile Avatar Section */
.profile-avatar-section-mobile {
    text-align: center;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    margin-bottom: 20px;
}

.avatar-preview-mobile {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 4px solid var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
}

.avatar-preview-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-hint-mobile {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

/* ===== EMPTY STATE ===== */
.empty-state-mobile {
    text-align: center;
    padding: 48px 24px;
    display: none;
}

.empty-state-mobile.show {
    display: block;
}

.empty-icon-mobile {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-mobile h3 {
    font-size: var(--font-2xl);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-mobile p {
    font-size: var(--font-base);
    color: var(--text-tertiary);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    right: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--primary-blue);
    color: white;
    padding: 16px;
    border-radius: 12px;
    font-size: var(--font-sm);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: toastSlide var(--transition-base);
    pointer-events: auto;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== TABLET & DESKTOP ENHANCEMENTS ===== */
@media (min-width: 768px) {
    :root {
        --mobile-padding: 24px;
        --mobile-gap: 16px;
    }

    .pins-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .type-selector {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-title-mobile {
        font-size: var(--font-3xl);
    }
}

@media (min-width: 1024px) {
    .pins-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .pins-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* ===== HERO IMAGE FOR ANNOUNCEMENTS & NEWS ===== */
.pin-card-mobile.has-image {
    padding: 0;
}

.pin-hero-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-tertiary);
    position: relative;
}

.pin-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.pin-card-mobile:active .pin-hero-image img {
    transform: scale(1.05);
}

/* Loading placeholder for images */
.pin-hero-image::before {
    content: '???';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.3;
    z-index: 0;
}

.pin-hero-image img {
    position: relative;
    z-index: 1;
}

/* Pin content wrapper for cards with images */
.pin-card-mobile .pin-content {
    padding: 16px;
}