@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* --- NEW PREMIUM PALETTE --- */
    --primary: #0d2c4b;
    --primary-light: #1a4a7a;
    --primary-glow: rgba(13, 44, 75, 0.15);

    --accent: #f3b63a;
    --accent-hover: #e0a325;
    --accent-glow: rgba(243, 182, 58, 0.3);

    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;

    /* --- DESIGN TOKENS --- */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE STYLES --- */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(13, 44, 75, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(243, 182, 58, 0.03) 0px, transparent 50%);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- PREMIUM NAVBAR --- */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 64px;
    box-shadow: 0 1px 0 var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    transition: var(--transition);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pm-logo {
    color: var(--primary);
    font-size: 38px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.pm-logo i {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.pm-logo:hover {
    transform: scale(1.05);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(241, 245, 249, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 10px 18px;
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    width: 320px;
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-box i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    width: 100%;
}

.nav-center {
    display: flex;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

.nav-tab {
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    transform: scaleX(0);
    transition: var(--transition);
}

.nav-tab:hover {
    color: var(--primary);
}

.nav-tab.active {
    color: var(--primary);
}

.nav-tab.active::after {
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--glass-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.nav-icon:hover {
    background-color: white;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notif-dot,
.msg-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.nav-profile-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.nav-profile-container:hover {
    background: white;
    border-color: var(--accent);
}

.nav-profile {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid white !important;
    box-shadow: var(--shadow-sm);
    display: block;
}

.nav-profile-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

/* --- MAIN LAYOUT --- */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 24px;
    max-width: 1400px;
    margin: 80px auto 24px;
    padding: 0 24px;
}

/* --- SIDEBARS --- */
.left-sidebar,
.right-sidebar {
    position: sticky;
    top: 88px;
    height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    backdrop-filter: blur(10px);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.98rem;
    transition: var(--transition);
}

.sidebar-item:hover {
    background-color: var(--primary-glow);
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-item i {
    font-size: 1.4rem;
    width: 24px;
    display: flex;
    justify-content: center;
}

.sidebar-title {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 12px;
    padding-left: 16px;
}

/* --- MAIN FEED --- */
.main-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* --- CREATE POST --- */
.create-post-card {
    padding: 20px;
}

.create-post-top {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.create-post-top img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    box-shadow: var(--shadow-sm) !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.create-post-input-wrapper textarea {
    display: block;
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 12px 45px 12px 0 !important;
    font-size: 1.15rem !important;
    font-family: 'Outfit', sans-serif !important;
    color: var(--text-main) !important;
    resize: none !important;
    min-height: 50px;
    max-height: 300px;
    line-height: 1.6 !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.create-post-input-wrapper textarea::placeholder {
    color: #94a3b8;
    opacity: 0.7;
}

/* Kontejner oko textarea da bi on imao pozadinu i border */
.create-post-input-wrapper {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 4px 16px;
    position: relative;
    transition: var(--transition);
}

.create-post-input-wrapper:focus-within {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    z-index: 100;
    width: 250px;
}

.emoji-picker span {
    cursor: pointer;
    font-size: 1.4rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
}

.emoji-picker span:hover {
    background: #f1f5f9;
    transform: scale(1.2);
}

.create-post-bottom {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.action-btn:hover {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.action-btn i {
    font-size: 1.2rem;
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary);
    border: none;
    padding: 10px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- POST CARD --- */
.post {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
}

.post-header-left {
    display: flex;
    gap: 12px;
}

.post-header-left img {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-author {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
    text-decoration: none;
}

.post-time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-header-right {
    position: relative;
}

.post-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.post-menu-btn:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.post-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.post-menu-dropdown a:hover {
    background: var(--bg);
}

.post-menu-dropdown a.delete-post-btn {
    color: var(--error);
}

.post-menu-dropdown a.delete-post-btn:hover {
    background: #fef2f2;
}

.post-content {
    padding: 0 20px 16px;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.6;
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-stats {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-badge {
    background: var(--accent);
    color: var(--primary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: var(--shadow-sm);
}

.post-actions-bar {
    padding: 4px 20px;
    display: flex;
    border-top: 1px solid var(--border);
}

.post-actions-bar .action-btn.liked {
    color: var(--accent-hover);
}

/* --- COMMENTS --- */
.comments-section {
    background: rgba(248, 250, 252, 0.5);
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-item img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.comment-bubble {
    background: white;
    padding: 10px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.comment-author {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
    display: block;
    color: var(--primary);
}

.add-comment-box {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.add-comment-box input {
    flex: 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 10px 20px;
    font-family: inherit;
    transition: var(--transition);
}

.add-comment-box input:focus {
    border-color: var(--accent);
    outline: none;
}

/* --- PREMIUM MAJSTOR CARDS --- */
.premium-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.premium-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.premium-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.premium-info h5 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary);
}

.premium-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 1001;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    gap: 4px;
}

.mobile-nav-item i {
    font-size: 1.5rem;
}

.mobile-nav-item.active {
    color: var(--primary);
}

/* --- RESPONSIVE --- */
@media (max-width: 1280px) {
    .app-container {
        grid-template-columns: 240px 1fr 260px;
    }
}

@media (max-width: 1100px) {
    .app-container {
        grid-template-columns: 80px 1fr 0;
    }

    .right-sidebar {
        display: none;
    }

    .sidebar-item span {
        display: none;
    }

    .sidebar-title {
        display: none;
    }

    .sidebar-card {
        padding: 8px;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        margin-top: 72px;
        padding: 0 16px;
    }

    .left-sidebar {
        display: none;
    }

    .nav-center {
        display: none;
    }
}

@media (max-width: 600px) {
    .navbar {
        padding: 0 16px;
        height: 60px;
    }

    .search-box {
        display: none;
    }

    .nav-profile-label {
        display: none;
    }

    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .main-feed {
        gap: 8px;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 80px;
    }

    .app-container {
        padding: 0;
    }
}


/* --- POST TYPE BADGES --- */
.post-type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-type-badge.demand {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(13, 44, 75, 0.1);
}

.post-type-badge.finished {
    background: rgba(243, 182, 58, 0.1);
    color: var(--accent-hover);
    border: 1px solid rgba(243, 182, 58, 0.2);
}

.post-type-badge i {
    font-size: 0.85rem;
}