/* --- Global Styles & Color Palette --- */
:root {
    --primary-bg: #0D0D0D;
    --secondary-bg: #1A1A1A;
    --accent-blue: #6C5CE7;
    --text-primary: #FFFFFF;
    --text-secondary: #B2B2B2;
    --positive-green: #00B894;
    --negative-red: #D63031;
    --border-color: #2D2D2D;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* --- Header & Navigation --- */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);

    /* --- THIS IS THE NEW CODE FOR THE STICKY HEADER --- */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header a {
    text-decoration: none;
    /* Remove underline from logo link */
}

/* Logo entrance animation */
@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    animation: logoFadeIn 0.6s ease-out;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
    /* Glow effect matching accent-blue */
}

.logo span {
    color: var(--accent-blue);
    transition: color 0.3s ease;
}

.logo:hover span {
    color: #a29bfe;
    /* Slightly lighter shade on hover */
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover,
.nav a.active {
    color: var(--text-primary);
}

/* --- Main Content Area --- */
.main-container {
    padding: 2rem;
    max-width: 1200px;
    /* Added for better centering on large screens */
    margin: 0 auto;
}

h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Crypto Table Example --- */
.crypto-table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
}

.crypto-table th,
.crypto-table td {
    padding: 0.5rem 0.5rem;
    /* Reduced padding for narrower columns */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}


/* Set specific column widths for compact 4-column layout */
.crypto-table th:nth-child(1),
.crypto-table td:nth-child(1) {
    width: 35%;
    /* Name column */
}

.crypto-table th:nth-child(2),
.crypto-table td:nth-child(2) {
    width: 20%;
    /* Price column */
}

.crypto-table th:nth-child(3),
.crypto-table td:nth-child(3) {
    width: 20%;
    /* 24h % column */
}

.crypto-table th:nth-child(4),
.crypto-table td:nth-child(4) {
    width: 25%;
    /* Market Cap column */
}

.crypto-table tr:last-child td {
    border-bottom: none;
    /* Added to remove border from the very last row */
}

.crypto-table th {
    color: var(--text-primary);
    font-weight: 600;
}

.price-up {
    color: var(--positive-green);
    font-weight: bold;
}

.price-down {
    color: var(--negative-red);
    font-weight: bold;
}

/* --- Coin Info (for live data) --- */
.coin-info {
    display: flex;
    align-items: center;
}

.coin-info img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.gold-icon {
    font-size: 24px;
    margin-right: 10px;
    display: inline-block;
}

/* --- CSS to add at the end of css/style.css --- */

/* --- Redesigned Blog Page Styles --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Responsive grid */
    gap: 1.5rem;
}

.blog-post-card {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    /* Ensures the image corners are rounded */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.blog-post-card img.post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    /* Ensures image covers the area without distortion */
}

.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Allows the content to fill the card */
}

.post-content h2 a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
}

.post-content h2 a:hover {
    color: var(--accent-blue);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem 0;
}

.post-excerpt {
    line-height: 1.6;
    flex-grow: 1;
    /* Pushes the "Read More" link to the bottom */
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: bold;
}

/* --- Homepage "Latest Posts" Section --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    /* Add space above the new section */
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin: 0;
}

.view-all-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: bold;
}

/* --- Ad-Ready Two-Column Layout --- */
.site-wrapper {
    display: flex;
    max-width: 1400px;
    /* Widen the site for sidebar */
    margin: 0 auto;
    padding: 1rem 2rem 2rem 2rem;
    gap: 2rem;

    /* --- THIS IS THE NEW LINE TO PREVENT OVERLAP --- */
    margin-top: 0;
    /* Creates space so content doesn't start under the header */
}

.main-content-area {
    flex: 1;
    /* Takes up the remaining space */
    min-width: 0;
    /* Prevents content from overflowing */
}

.sidebar {
    width: 300px;
    /* Fixed width for the sidebar */
    flex-shrink: 0;
    /* Prevents the sidebar from shrinking */
}

/* --- Sidebar Module Styling --- */
.sidebar-module {
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-module h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

/* --- Ad Placeholder Styling --- */
.ad-placeholder {
    background-color: #222;
    /* A slightly different dark color */
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 8px;
}

.ad-skyscraper {
    width: 300px;
    height: 600px;
}

.ad-leaderboard {
    width: 100%;
    min-height: 90px;
    margin-bottom: 2rem;
}

/* Responsive: On smaller screens, hide the sidebar and stack content */
@media (max-width: 992px) {
    .site-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}



/* --- Portfolio Page Specific Styles --- */
.portfolio-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.summary-card {
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-grow: 1;
}

.summary-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.summary-card .value {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: bold;
}

.summary-card .value.positive {
    color: var(--positive-green);
}

.summary-card .value.negative {
    color: var(--negative-red);
}

/* --- Add Asset Form Styling --- */
.add-asset-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

.add-asset-form input {
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.add-asset-form input::placeholder {
    color: var(--text-secondary);
}

.add-asset-form button {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    border: none;
    background-color: var(--accent-blue);
    color: var(--text-primary);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-asset-form button:hover {
    background-color: #5a4ab9;
}

/* --- CSS to add at the end of css/style.css --- */

/* --- Professional Portfolio Page Styles --- */
.portfolio-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.portfolio-intro .profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--accent-blue);
    margin-bottom: 1rem;
}

.skills-section {
    background-color: var(--secondary-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    justify-content: center;
}

.skills-list li {
    background-color: var(--primary-bg);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.project-card {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: flex;
    overflow: hidden;
    gap: 2rem;
}

.project-card .project-image {
    width: 40%;
    object-fit: cover;
}

.project-card .project-info {
    padding: 2rem 2rem 2rem 0;
    width: 60%;
}

.project-card h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.project-card .project-tags {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-card .tag {
    background-color: var(--accent-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Responsive for project cards on smaller screens */
@media (max-width: 768px) {
    .project-card {
        flex-direction: column;
    }

    .project-card .project-image,
    .project-card .project-info {
        width: 100%;
    }

    .project-card .project-info {
        padding: 0 2rem 2rem 2rem;
    }
}

/* --- CSS to add at the end of css/style.css --- */

/* --- Telegram CTA Module Styling --- */
.telegram-cta {
    background: linear-gradient(45deg, #2AABEE, #229ED9);
    /* Telegram's blue gradient */
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #47bcf1;
}

.telegram-cta h3 {
    color: white;
    margin-top: 0;
    font-size: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.telegram-cta p {
    color: #e0f2ff;
    /* A light blueish-white */
    font-size: 1rem;
}

.telegram-cta .cta-button-telegram {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: #2AABEE;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: transform 0.2s ease;
    margin-top: 1rem;
}

.telegram-cta .cta-button-telegram:hover {
    transform: scale(1.05);
}

/* --- Homepage Banner Version --- */
.telegram-banner {
    margin-bottom: 3rem;
    /* Space it out from other content */
}



/* --- Simple Two-Column Grid --- */
.two-column-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Two equal columns */
    gap: 2rem;
    /* Space between the columns */
    margin-bottom: 3rem;
}

/* On smaller screens, stack them to one column */
@media (max-width: 768px) {
    .two-column-grid {
        grid-template-columns: 1fr;
    }
}


/* --- CSS to add at the end of css/style.css --- */

/* --- Footer Styling --- */
.site-footer {
    background-color: var(--secondary-bg);
    color: var(--text-secondary);
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    text-align: center;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-copyright {
        text-align: center;
        margin-top: 1rem;
    }
}


/* --- Blog Page Visibility Fix --- */
.main-content-area .blog-grid {
    min-height: 300px;
    /* Ensures the container has a minimum height to be visible */
    width: 100%;
    /* Ensures it takes up the full width of its parent */
}

/* --- Donate Us CTA Module Styling --- */
.donate-cta {
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.donate-cta .icon {
    font-size: 2.5rem;
    color: var(--positive-green);
    margin-bottom: 1rem;
}

.donate-cta h3 {
    color: var(--text-primary);
    margin-top: 0;
    font-size: 1.2rem;
}

.donate-cta p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.donate-cta .cta-button-donate {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--positive-green);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.donate-cta .cta-button-donate:hover {
    background-color: #00a082;
    /* A slightly darker green */
}

/* --- Category Filter Menu Styling --- */
.category-filter-menu {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    /* Allows filters to wrap on smaller screens */
}

.category-filter-menu button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    /* Pill-shaped buttons */
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-filter-menu button:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

/* The style for the currently selected filter */
.category-filter-menu button.active {
    background-color: var(--accent-blue);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

/* =================================================================
   MOBILE RESPONSIVENESS IMPROVEMENTS
   ================================================================= */

/* --- Hamburger Menu Styling --- */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1001;
    /* Ensures hamburger is above nav (z-index: 999) */
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Show hamburger on mobile, hide desktop nav */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: var(--secondary-bg);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 999;
        pointer-events: none;
        /* Prevent blocking clicks when hidden */
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        /* Enable clicks when visible */
    }

    .nav a {
        margin: 0;
        padding: 1rem 2rem;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav a:last-child {
        border-bottom: none;
    }

    /* Hamburger animation when active */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    /* Mobile styles for sidebar CTA buttons */
    .sidebar-module.telegram-cta .cta-button-telegram,
    .sidebar-module.donate-cta .cta-button-donate {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* --- Mobile Table Responsiveness --- */
@media (max-width: 600px) {

    /* Wrap table in scrollable container */
    .crypto-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .crypto-table th,
    .crypto-table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.85rem;
    }

    .coin-info img {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .gold-icon {
        font-size: 20px;
        margin-right: 6px;
    }
}

/* --- Legal Pages (Privacy Policy & Terms) --- */
.legal-content {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    line-height: 1.8;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legal-content h1 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.legal-content h2 {
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.legal-content p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    text-align: justify;
}

.legal-content ul {
    margin-left: 0;
    padding-left: 0;
    margin-bottom: 1.5rem;
    list-style-type: none;
}

.legal-content li {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: justify;
}

.legal-content strong {
    color: var(--text-primary);
}

.legal-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.last-updated {
    font-style: italic;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    display: block;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem;
        margin: 1.5rem 1rem;
    }

    .legal-content h1 {
        font-size: 2rem;
    }
}

/* --- Post Navigation Bar Responsive Styles --- */
.post-navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

@media (max-width: 768px) {
    .post-navigation-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .post-navigation-bar a {
        width: 100%;
        justify-content: center !important;
        text-align: center;
    }
}

/* --- Mobile Typography Scaling --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .header {
        padding: 1rem 1.5rem;
    }

    .main-container {
        padding: 1.5rem;
    }

    .site-wrapper {
        padding: 1rem 1.5rem 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .header {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }
}

/* --- Mobile Touch Targets --- */
@media (max-width: 768px) {

    .cta-button-telegram,
    .cta-button-donate,
    .read-more,
    .category-filter-menu button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .category-filter-menu button {
        padding: 0.75rem 1.25rem;
    }
}

/* --- Mobile Blog Grid --- */
@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Mobile CTA Boxes Optimization --- */
@media (max-width: 992px) {

    /* Reduce padding on sidebar modules for mobile */
    .sidebar-module {
        padding: 1rem;
    }

    /* Reduce padding on telegram CTA specifically */
    .telegram-cta {
        padding: 1rem;
    }

    .telegram-cta h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .telegram-cta p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Reduce padding on donate CTA */
    .donate-cta {
        padding: 1rem;
    }

    .donate-cta .icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .donate-cta h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .donate-cta p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Ensure buttons are centered and have proper touch target size */
    .cta-button-telegram,
    .cta-button-donate {
        display: block;
        width: fit-content;
        margin: 0.75rem auto 0 auto;
        padding: 0.75rem 1.5rem;
    }
}