@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    /* Color Palette */
    --bg-dark: #0f1115;
    --bg-card: #181b21;
    --bg-card-hover: #1f232b;
    --primary: #8b5cf6;
    /* Violet */
    --primary-hover: #7c3aed;
    --accent: #06b6d4;
    /* Cyan */
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --danger: #ef4444;
    --success: #22c55e;
    --border: #2d3139;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(139, 92, 246, 0.4) 0%, transparent 70%);

    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
header {
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

.search-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    transition: 0.3s;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    margin-left: 8px;
    font-size: 0.9rem;
}

.search-bar i {
    color: var(--text-muted);
}

.btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Hero Section --- */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: var(--gradient-glow);
    filter: blur(80px);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero h1 .highlight {
    background: linear-gradient(to right, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* --- Main Layout Grid --- */
.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    /* Sidebar - Feed - Trending */
    gap: 32px;
    padding: 40px 0;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr 300px;
    }

    .sidebar-left {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-right {
        display: none;
    }
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    transition: 0.3s;
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: var(--bg-card-hover);
}

/* --- Feed Post --- */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.meta h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.company-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.post-content h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
}

.post-content p {
    color: #cbd5e1;
    font-size: 1rem;
    margin-bottom: 16px;
    line-height: 1.7;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.action-btn:hover {
    color: var(--text-main);
}

.action-btn.upvote:hover {
    color: var(--success);
}

.action-btn.downvote:hover {
    color: var(--danger);
}

/* --- Sidebars --- */
.section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 700;
}

.menu-list li {
    margin-bottom: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
}

.menu-link:hover,
.menu-link.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

.trending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trending-info h4 {
    font-size: 0.95rem;
    color: var(--text-main);
}

.trending-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rating-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.rating-low {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.rating-mid {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
}

/* --- Modal --- */
.modal {
    display: none;
    /* JS to toggle */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    /* Higher than navbar */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* --- Company Grid --- */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.company-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.company-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.comp-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 15px;
    background: #2d3748;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #718096;
}

.comp-score {
    margin-top: auto;
    /* Push to bottom */
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-muted);
    padding-top: 10px;
}

/* Mobile Adjustments for Companies */
@media (max-width: 768px) {
    .company-grid {
        grid-template-columns: 1fr;
        /* Single column for better mobile view */
        gap: 16px;
    }

    .company-card {
        flex-direction: row;
        text-align: left;
        align-items: center;
        padding: 16px;
        min-height: auto;
    }

    .comp-logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0;
        margin-right: 15px;
    }

    .company-card h3 {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .comp-score {
        padding-top: 0;
        margin-top: 0;
        margin-left: auto;
        font-size: 0.8rem;
    }

    .rating-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}


.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 600px;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.disclaimer-box {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.disclaimer-box h4 {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer-box p {
    font-size: 0.8rem;
    color: #d1d5db;
}

/* Disclaimer Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out forwards;
}

.bottom-nav {
    display: none;
}

/* --- Mobile Responsive Fixes --- */
@media (max-width: 768px) {

    /* Header Adjustments */
    /* Header Adjustments */
    .nav-wrapper {
        display: grid;
        grid-template-columns: 1fr auto;
        /* Logo Left, Actions Right */
        gap: 12px;
        padding: 10px 15px;
        align-items: center;
    }

    .logo {
        margin-bottom: 0;
        justify-content: flex-start;
        width: auto;
    }

    .logo img {
        height: 50px !important;
        /* Smaller optimized logo for mobile */
    }

    /* Search Bar moves to the next row automatically or via order if flex. 
       Grid is better here: Row 2, spanning full width. 
    */
    .search-bar {
        grid-column: 1 / -1;
        /* Span Full Width */
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .nav-actions {
        width: auto;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .nav-actions .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Hero Section */
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-special {
        padding: 80px 15px !important;
        min-height: 400px !important;
    }

    .hero-special h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 10px;
    }

    /* Main Grid */
    .main-grid {
        display: flex;
        flex-direction: column;
        padding: 20px 15px;
        gap: 20px;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .feed {
        width: 100%;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Post Card Mobile */
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-header>div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Bottom Navigation */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(15, 17, 21, 0.95);
        backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        gap: 4px;
        width: 100%;
        height: 100%;
    }

    .bottom-nav .nav-item i {
        font-size: 1.4rem;
        transition: 0.2s;
    }

    .bottom-nav .nav-item.active {
        color: var(--primary);
    }

    .bottom-nav .nav-item.center-btn {
        position: relative;
    }

    .bottom-nav .nav-item.center-btn .circle {
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
        transform: translateY(-15px);
        border: 4px solid var(--bg-dark);
    }

    /* Adjust body padding so content isn't hidden */
    body {
        padding-bottom: 90px;
        /* Slightly more than navbar height */
    }
}



/* Desktop: Hide Bottom Nav */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}