/* Wong Jambi - Mobile First CSS */
:root {
    --primary-color: #D4AF37;
    --secondary-color: #B8860B;
    --accent-color: #2C3E50;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E9ECEF;
    --success-color: #27AE60;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 16px;
    overflow-x: hidden;
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    height: 56px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

/* Main content spacing */
.main-content {
    margin-top: 56px;
    padding: 8px 16px 20px 16px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.main-content.with-bottom-nav {
    padding-bottom: 100px;
}

/* Mobile optimizations for spacing */
@media (max-width: 768px) {
    .header {
        height: 52px;
    }
    
    .header-content {
        padding: 6px 12px;
    }
    
    .main-content {
        margin-top: 52px;
        padding: 6px 8px 20px 8px;
    }
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.header .logo {
    width: 40px;
    height: 40px;
    margin: 0;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-2px);
}

/* Hashtag Display in Posts */
.hashtag-display {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.hashtag-display.hashtag-category {
    background: var(--primary-color);
    color: white;
}

.hashtag-display.hashtag-wilayah {
    background: var(--success-color);
    color: white;
}

.hashtag-display.hashtag-other {
    background: var(--text-light);
    color: white;
}

.hashtag-display:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-item {
    padding: 8px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: var(--bg-light);
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section p {
    font-size: 1.1rem;
    margin-bottom: 32px;
    opacity: 0.9;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    min-width: 120px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #34495E;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--accent-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 600px;
    width: 100%;
}

.feature-item {
    background: rgba(255,255,255,0.1);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    color: white;
    backdrop-filter: blur(10px);
}

.feature-item h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

/* Post Styles */
.post-card {
    border-left: 4px solid var(--primary-color);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-info .meta {
    font-size: 12px;
    color: var(--text-light);
}

.post-content {
    margin-bottom: 16px;
    line-height: 1.6;
}

.post-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 12px 0;
}

/* Thumbnail Layout - Compact & Clean */
.post-images-thumbnails {
    margin: 8px 0;
}

/* Single thumbnail */
.thumbnail-single {
    width: 100%;
    max-width: 300px;
}

.thumbnail-single .post-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail-single .post-thumbnail:hover {
    transform: scale(1.02);
}

/* Thumbnail grid - 2 thumbnails side by side */
.thumbnail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    max-width: 300px;
}

.thumbnail-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.post-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-thumbnail:hover {
    transform: scale(1.05);
}

/* Overlay for +N photos */
.thumbnail-item.with-overlay {
    position: relative;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.thumbnail-overlay:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .thumbnail-single {
        max-width: 100%;
    }

    .thumbnail-grid {
        max-width: 100%;
    }

    .thumbnail-single .post-thumbnail {
        height: 100px;
    }

    .post-thumbnail {
        height: 90px;
    }

    .thumbnail-overlay {
        font-size: 20px;
    }
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.action-btn.voted-up {
    color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

.action-btn.voted-down {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    border: none;
    background: none;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Mobile Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    padding: 8px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    min-width: 60px;
}

.bottom-nav-item.active {
    color: var(--primary-color);
    background: rgba(212, 175, 55, 0.1);
}

.bottom-nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-small { font-size: 14px; }
.text-xs { font-size: 12px; }
.font-weight-bold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Responsive Design */
@media (min-width: 480px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .auth-buttons {
        gap: 24px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
    
    .features {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bottom-nav {
        display: none;
    }

    .fab {
        bottom: 70px;
    }
    
    .header-content {
        padding: 16px 24px;
    }
    
    .card-body {
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .landing-container {
        padding: 40px 24px;
    }
    
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    .hero-section p {
        font-size: 1.2rem;
        max-width: 500px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #E9ECEF;
        --text-light: #ADB5BD;
        --bg-light: #212529;
        --bg-white: #343A40;
        --border-color: #495057;
    }
    
    .btn-outline {
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    
    .btn-outline:hover {
        background: var(--primary-color);
        color: var(--text-dark);
    }
}

/* PWA Styles */
.install-prompt {
    position: fixed;
    bottom: 100px;
    left: 20px;
    right: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 101;
}

.install-prompt.show {
    display: block;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* Custom Toast Notifications */
.custom-toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.toast-details {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.3;
    margin-top: 4px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0,0,0,0.1);
    color: var(--text-dark);
}

/* Toast responsive */
@media (max-width: 768px) {
    .custom-toast {
        max-width: 95% !important;
        min-width: 280px !important;
        top: 70px !important;
    }
    
    .toast-content {
        padding: 12px;
        gap: 10px;
    }
    
    .toast-icon {
        font-size: 18px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .toast-details {
        font-size: 11px;
    }
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* PWA Fullscreen mode - cover status bar completely */
@media (display-mode: fullscreen) {
    body {
        padding-top: 0 !important;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--bg-white);
        padding-top: max(env(safe-area-inset-top), 24px);
        height: auto;
        min-height: calc(56px + max(env(safe-area-inset-top), 24px));
        z-index: 1000;
    }

    .main-content {
        margin-top: calc(56px + max(env(safe-area-inset-top), 24px)) !important;
        padding-top: 8px;
    }

    @media (max-width: 768px) {
        .header {
            min-height: calc(52px + max(env(safe-area-inset-top), 24px));
        }

        .main-content {
            margin-top: calc(52px + max(env(safe-area-inset-top), 24px)) !important;
        }
    }
}

/* PWA Standalone mode */
@media (display-mode: standalone) {
    body {
        overflow-x: hidden;
    }

    .header {
        padding-top: max(env(safe-area-inset-top), 24px);
        height: auto;
        min-height: calc(56px + max(env(safe-area-inset-top), 24px));
    }

    .main-content {
        margin-top: calc(56px + max(env(safe-area-inset-top), 24px)) !important;
    }

    @media (max-width: 768px) {
        .header {
            min-height: calc(52px + max(env(safe-area-inset-top), 24px));
        }

        .main-content {
            margin-top: calc(52px + max(env(safe-area-inset-top), 24px)) !important;
        }
    }
}

/* Safe area for notched devices (fallback) */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
}

.bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* Verified Badge Styles */
.verified-badge, .verified-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
    vertical-align: middle;
}

.verified-badge-large {
    font-size: 14px;
    gap: 6px;
    margin-left: 6px;
    border-radius: 14px;
}

/* Blue checkmark (Twitter/X style) */
.verified-blue {
    background: #1d9bf0;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.verified-badge-large .verified-blue {
    width: 20px;
    height: 20px;
    font-size: 13px;
}

/* Label badges for institutions */
.verified-label {
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.verified-badge-large .verified-label {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 14px;
}

.verified-label .verified-icon {
    font-size: 10px;
    margin-right: 2px;
}

.verified-badge-large .verified-label .verified-icon {
    font-size: 11px;
    margin-right: 3px;
}

.verified-label .verified-text {
    font-size: inherit;
}

/* Icon-only verified badges */
.verified-icon-only {
    font-size: 14px;
    margin-left: 2px;
}

.verified-badge-large .verified-icon-only {
    font-size: 16px;
    margin-left: 3px;
}

/* Hover effects */
.verified-badge:hover, .verified-badge-large:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Verified badge in different contexts */
.post-author .verified-badge {
    margin-left: 6px;
}

.user-info .verified-badge {
    margin-left: 4px;
}

.conversation-header .verified-badge {
    margin-left: 4px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .verified-badge {
        font-size: 10px;
    }
    
    .verified-badge-large {
        font-size: 12px;
    }
    
    .verified-blue {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .verified-badge-large .verified-blue {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .verified-label {
        padding: 1px 6px;
        font-size: 9px;
    }
    
    .verified-badge-large .verified-label {
        padding: 2px 8px;
        font-size: 10px;
    }
}