/* --- GLOBAL --- */
:root {
    --bg: #FAFAFA;
    --text: #111827;
    --card-bg: #ffffff;
    --desc-color: #6B7280;
    --glass: rgba(255, 255, 255, 0.75);
    --primary: #4facfe;
    --gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --border: #E5E7EB;
    --card-hover-border: #93C5FD;
}

[data-theme="dark"] {
    --bg: #030712;
    --text: #F9FAFB;
    --card-bg: #111827;
    --desc-color: #9CA3AF;
    --glass: rgba(17, 24, 39, 0.75);
    --border: #1F2937;
    --card-hover-border: #3B82F6;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; /* ෆෝන් එකෙන් ඔබද්දි වැටෙන නිල්/අළු කොටුව අයින් කරයි */
}

a:focus, button:focus, input:focus {
    outline: none;
}

body { 
    font-family: 'Poppins', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    transition: 0.3s ease; 
    visibility: visible; 
    animation: siteFadeIn 0.6s ease forwards; 
}

a { 
    text-decoration: none; 
    color: inherit; 
}

img { 
    width: 100%; 
    display: block; 
}

/* --- APP-STYLE NAVBAR (NEW) --- */
.app-navbar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 15px 5%; 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    background: var(--glass); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.nav-left, .nav-right {
    flex: 1; /* Keeps the center perfectly in the middle */
}
.nav-right { display: flex; justify-content: flex-end; }

/* The Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--desc-color);
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.2s;
    background: transparent;
}
.back-btn:hover {
    background: var(--border);
    color: var(--text);
}

/* The Breadcrumb Badge (Replaces the Name) */
.nav-center {
    display: flex;
    justify-content: center;
}
.breadcrumb-badge {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--desc-color);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.breadcrumb-badge i { color: var(--primary); }
.breadcrumb-badge .divider { color: var(--border); margin: 0 4px; }

#themeToggle { background: none; border: none; font-size: 1.2rem; color: var(--text); cursor: pointer; padding: 8px; }

/* --- PAGE HEADER & STATUS TAG --- */
.page-header { text-align: center; padding: 60px 5% 40px; }

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}
/* The pulsing green dot */
.dot { width: 8px; height: 8px; background-color: #10B981; border-radius: 50%; display: inline-block; }
.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.page-header h1 { font-size: 3rem; font-weight: 700; margin-bottom: 15px; letter-spacing: -1px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.page-header p { color: var(--desc-color); font-size: 1.1rem; max-width: 600px; margin: 0 auto;}

/* --- SEARCH BAR --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 5% 80px; }
.toolbar { margin-bottom: 40px; display: flex; justify-content: center; }
.search-wrapper { position: relative; width: 100%; max-width: 600px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 18px; color: var(--desc-color); font-size: 1.1rem; }
#searchInput {
    width: 100%; padding: 16px 50px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 1rem; color: var(--text); font-family: inherit; transition: 0.3s;
}
#searchInput:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.15); }
.search-shortcut { position: absolute; right: 15px; background: var(--bg); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; color: var(--desc-color); font-weight: 500; }

/* --- CARDS & GRID --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }

.pro-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden; transition: all 0.3s ease;
    display: flex; flex-direction: column;
}
.pro-card:hover { transform: translateY(-5px); border-color: var(--card-hover-border); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04); }

.card-img-wrapper { position: relative; height: 180px; overflow: hidden; border-bottom: 1px solid var(--border); }
.card-img-wrapper img { height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.pro-card:hover .card-img-wrapper img { transform: scale(1.05); }

.card-badge { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); color: white; padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; }

.pro-card-content { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.tech-stack { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tech-stack span { background: var(--bg); border: 1px solid var(--border); color: var(--desc-color); font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; }

.pro-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.pro-desc { font-size: 0.9rem; color: var(--desc-color); line-height: 1.6; margin-bottom: 24px; }

.card-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 15px; }
.pro-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
.pro-btn:hover { color: #00f2fe; gap: 12px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-center { display: flex; }
    .breadcrumb-badge { font-size: 0.7rem; padding: 4px 10px; gap: 4px; }
    .breadcrumb-badge .divider { display: none; }
    .back-btn span { display: none; }
    
    .page-header h1 { font-size: 2.4rem; }
    .search-shortcut { display: none; }
}

/* --- PAGINATION STYLES --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}
.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--gradient); color: white; border: none; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--border); color: var(--desc-color); background: var(--bg); }

/* ==========================================
   BOTTOM ACTIONS (Quick Nav & CTA)
========================================== */
.bottom-actions {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* 1. Quick Navigate Styles */
.quick-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.nav-hint {
    font-size: 0.85rem;
    color: var(--desc-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-page-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s ease;
}

.next-page-link i {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.next-page-link:hover {
    color: var(--primary);
}

.next-page-link:hover i {
    transform: translateX(8px); /* ඊතලේ ඉස්සරහට යනවා */
}

/* 2. CTA Block Styles */
.cta-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

/* පොඩි ලස්සන Glow Effect එකක් කොටුව ඇතුලේ */
.cta-block::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(79,172,254,0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.cta-content p {
    color: var(--desc-color);
    font-size: 1rem;
}

.cta-btn {
    position: relative;
    z-index: 1;
    background: var(--gradient);
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
    transition: 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(79, 172, 254, 0.4);
}

/* ==========================================
   RESPONSIVE (MOBILE) FIXES
========================================== */
@media (max-width: 768px) {
    /* 1. Breadcrumb Badge (Workspace / Page Name) */
    .nav-center { display: flex; }
    
    /* හැම page එකේම අකුරු එකම size එකට තියෙන්න හැදුවා */
    .breadcrumb-badge { 
        font-size: 0.8rem; /* කලින් තිබ්බ පොඩි ගතිය නැති කරා */
        padding: 5px 12px; 
        gap: 6px; 
    }

    
    /* අර නැති වෙලා ගිය '/' කෑල්ල ආයෙත් පෙන්නුවා */
    .breadcrumb-badge .divider { 
        display: inline-block; 
    }

    /* 2. Back Button */
    .back-btn span { display: none; } /* 'Home' අකුරු අයින් කරලා icon එක විතරක් තියමු */
    
    /* 3. Page Header */
    .page-header h1 { font-size: 2.4rem; }
    
    /* 4. Search Box */
    .search-shortcut { display: none; }
    
    /* 5. Bottom CTA Box */
    .cta-block { 
        flex-direction: column; 
        text-align: center; 
        padding: 30px 20px; 
        gap: 25px; 
    }
    .next-page-link { font-size: 1.2rem; }
    .cta-content h2 { font-size: 1.5rem; }
    
    /* 6. Popup Modal (For Templates Page) */
    .modal-content { padding: 30px 20px; }
}


@keyframes siteFadeIn {
    0% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
}