/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

:root {
    --primary: #FF9E00; /* Fun Sunny Orange */
    --secondary: #00B4D8; /* Electric Blue */
    --accent: #FF5400; /* Deep Orange */
    --success: #38B000; /* Lime Green */
    --bg-light: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-dark: #212529;
    --text-muted: #6C757D;
    
    /* Box shadows for floating effects */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.15);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent; /* better for mobile PWA */
}

/* Container */
#app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for bottom nav */
    position: relative;
    background-color: var(--bg-light);
    box-shadow: 0 0 20px rgba(0,0,0,0.02);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    background-color: var(--card-bg);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logoText {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--primary);
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

.icon-btn {
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Main Content */
main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Views Logic */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active-view {
    display: block;
}

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

/* Dashboard Cards */
.welcome-card {
    background: linear-gradient(135deg, var(--secondary), #48CAE4);
    color: white;
    padding: 30px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    text-align: left;
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.welcome-card p {
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid transparent;
}

.card:active {
    transform: scale(0.95);
    border-color: var(--primary);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
}

.blue-bg { background-color: var(--secondary); }
.green-bg { background-color: var(--success); }

.card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

/* Form Styles */
.view-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: left;
}

.fun-form {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

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

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    background-color: var(--bg-light);
    border: 2px solid #E9ECEF;
    border-radius: var(--radius-md);
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: border-color 0.3s ease;
    resize: vertical;
}

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

.super-btn {
    width: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.super-btn:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-sm);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 158, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 158, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 158, 0, 0); }
}

.hidden {
    display: none !important;
}

/* User Profile & Avatars */
.ceo-directory-strip {
    display: flex;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    gap: 15px;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}
.ceo-directory-strip::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.directory-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    cursor: pointer;
    transition: transform 0.2s;
}

.directory-user:hover {
    transform: scale(1.05);
}

.avatar-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), #48CAE4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    margin-bottom: 5px;
    object-fit: cover;
}

.directory-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* Edit Profile Box */
.profile-edit-box {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 2px solid #E9ECEF;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Launched Biz Horizontal Slider Cards */
.biz-launch-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
    max-width: 130px;
    background: white;
    padding: 10px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid #E9ECEF;
    cursor: default;
    transition: transform 0.2s;
    text-align: center;
}

.biz-launch-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.biz-launch-img {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10B981, #34D399); 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    object-fit: cover;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.biz-launch-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.biz-launch-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.biz-launch-link {
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    text-decoration: none;
    width: 100%;
}

.biz-launch-link:active {
    opacity: 0.8;
}

.profile-edit-box .avatar-icon {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    margin-bottom: 10px;
}

.avatar-controls {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-upload-avatar {
    background: var(--secondary);
    color: white;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 800;
    flex: 1;
    cursor: pointer;
    text-align: center;
}

.btn-delete-avatar {
    background: #ef4444;
    color: white;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 800;
    cursor: pointer;
}

.success-msg {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--success);
    background: #E8F5E9;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Mood Selector */
.mood-selector .moods {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.mood-btn {
    flex: 1;
    text-align: center;
    background: var(--bg-light);
    border: 2px solid #E9ECEF;
    padding: 12px 5px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mood-btn.selected {
    background: #E1F5FE;
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 5px 20px 5px; /* Shrunk padding */
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.7rem; /* Shrunk font */
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 18%; /* Limit width to fit 5 perfectly */
}

.nav-item i {
    font-size: 1.3rem; /* Shrunk icon */
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

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

.nav-item.active i {
    transform: translateY(-5px);
}

/* Image Previews and Display Grids */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.thumbnail-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 2px solid #E9ECEF;
    animation: fadeIn 0.3s ease forwards;
}

.feed-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.feed-image-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #CED4DA;
}

/* Authentication Styles */
.auth-helper {
    text-align: center;
    margin-top: 15px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-helper a {
    color: var(--secondary);
    font-weight: 800;
    text-decoration: none;
}

.auth-helper a:hover {
    text-decoration: underline;
}

.auth-divider {
    border: 0;
    height: 1px;
    background: #E9ECEF;
    margin: 20px 0;
}

.error-msg {
    margin-top: 15px;
    font-size: 1rem;
    font-weight: 700;
    color: #D32F2F;
    background: #FFEBEE;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Feed & Gallery Cards */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 30px;
}

.feed-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid #E9ECEF;
    transition: transform var(--transition) ease;
}

.feed-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px dashed #E9ECEF;
    padding-bottom: 10px;
}

.feed-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary);
}

.feed-author {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #F8F9FA;
    padding: 4px 10px;
    border-radius: 20px;
}

.feed-body p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.feed-label {
    font-weight: 800;
    color: var(--secondary);
}

.feed-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #E9ECEF;
    display: flex;
    justify-content: flex-end;
}

.toggle-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition) ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-private {
    background-color: #F8F9FA;
    border: 2px solid #CED4DA;
    color: #6C757D;
}

.btn-public {
    background-color: #E8F5E9;
    border: 2px solid #4CAF50;
    color: #2E7D32;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 700;
}

/* Accordion UI for Journals */
.accordion-header {
    cursor: pointer;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    opacity: 0.8;
}

.accordion-body {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #E9ECEF;
    animation: fadeIn 0.3s ease;
}

.accordion-body.open {
    display: block;
}

.chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.chevron.open {
    transform: rotate(180deg);
}

/* Legal & Safety Styles */
.global-legal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 30px 10px 90px 10px;
    border-top: 1px solid #E9ECEF;
    margin-top: 40px;
}

.legal-link {
    font-size: 0.75rem;
    color: #A1A1AA;
    text-decoration: none;
    font-weight: 600;
}

.legal-link:hover {
    color: var(--primary);
}

.legal-report-btn {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 800;
    text-decoration: none;
    padding: 3px 10px;
    border: 1px solid #ef4444;
    border-radius: 6px;
    transition: all 0.2s;
}

.legal-report-btn:hover {
    background: #ef4444;
    color: white;
}

.legal-document {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-dark);
}

.legal-document h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--primary);
    border-bottom: 2px solid #E9ECEF;
    padding-bottom: 5px;
}

.legal-document h4 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--secondary);
}

.legal-document p, .legal-document ul {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.legal-document li {
    margin-bottom: 8px;
    margin-left: 20px;
}

.highlight-red {
    color: #ef4444;
    font-weight: 800;
}

