/* ==========================================================================
   COLOR SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --mockup-bg: #f1f5f9;
    --mockup-inner: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #111827;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.12);
    --navbar-bg: rgba(15, 23, 42, 0.85);
    --mockup-bg: #0b0f19;
    --mockup-inner: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Base Typography & Smooth Transition */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

section {
    padding: 90px 0;
}

.bg-sec {
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

/* Clean SaaS Card Styling */
.saas-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Typography Helper Classes */
.text-main { color: var(--text-primary) !important; }
.text-sub { color: var(--text-secondary) !important; }
.text-accent { color: var(--accent) !important; }

/* Navbar Styling */
#navbar { min-height: 64px; }
#app    { min-height: 100vh; }
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0 4px;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent) !important;
}

/* Buttons */
.btn-accent {
    background-color: var(--accent);
    color: #ffffff !important;
    font-weight: 600;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-custom {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-outline-custom:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
}

/* Badges */
.badge-subtle {
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

/* Dashboard Mockup */
.mockup-container {
    background-color: var(--mockup-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.mockup-header {
    background-color: var(--bg-card);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.mockup-body {
    background-color: var(--mockup-inner);
    padding: 16px;
    transition: background-color 0.3s ease;
}

/* Filter Pills */
.filter-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Horizontal Timeline Desktop */
.timeline-wrapper {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: 15px;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-item {
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    background-color: var(--bg-card);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.timeline-item:hover .step-number {
    background-color: var(--accent);
    color: #ffffff;
}

/* Back to Top Floating Button */
#btn-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: none;
    z-index: 99;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Modal Theme Sync */
.modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.footer-section {
    position: relative;
}

.footer-description {
    max-width: 480px;
    line-height: 1.7;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-main);
    transform: translateX(3px);
}

.footer-social {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;

    color: var(--text-sub);
    text-decoration: none;

    background: rgba(255, 255, 255, 0.7);

    transition: all 0.2s ease;
}

.footer-social i {
    font-size: 1rem;
}

.footer-social:hover {
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.footer-bottom {
    min-height: 58px;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.95);

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.page-loader.hide {
    opacity: 0;
    visibility: hidden;
}

.page-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.page-loader .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

.page-loader-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub, #6c757d);
}

.project-detail-section {
    padding: 120px 0 80px;
}

.project-back-link {
    color: var(--text-sub);
    font-size: 0.875rem;
    transition: 0.2s ease;
}

.project-back-link:hover {
    color: var(--text-main);
}

.project-info-card {
    background: var(--bs-body-bg);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    padding: 24px;
}

.project-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.project-info-item span {
    color: var(--text-sub);
    font-size: 0.8rem;
}

.project-info-item strong {
    color: var(--text-main);
    font-size: 0.875rem;
    text-align: right;
}

.tech-badge {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 600;
}

.project-preview {
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.06);
}

.project-preview-header {
    height: 46px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.preview-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
}

.project-preview-body {
    background: #f8f9fa;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-preview-body img {
    width: 100%;
    display: block;
}

.project-content-section {
    padding: 20px 0;
}

.case-card {
    padding: 30px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    background: var(--bs-body-bg);
}

.case-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-accent);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.feature-card {
    height: 100%;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 14px;
    background: var(--bs-body-bg);
    transition: 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.feature-card > i {
    display: inline-flex;
    margin-bottom: 18px;
    font-size: 1.4rem;
    color: var(--text-accent);
}

.feature-card h5 {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.technology-section {
    padding: 35px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.025);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.tech-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bs-body-bg);
    border: 1px solid rgba(0, 0, 0, 0.07);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 600;
}

.tech-large i {
    font-size: 1.25rem;
}

.project-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.project-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.project-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.project-info-item span {
    color: var(--text-sub);
    font-size: 0.875rem;
}

.project-info-item strong {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
}

.tech-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 14px;

    color: var(--text-main);
    background: var(--bg-card);

    border: 1px solid var(--border-color);
    border-radius: 10px;

    font-size: 0.9rem;
    font-weight: 600;

    transition: all 0.2s ease;
}

.tech-large i {
    font-size: 1.25rem;
}

.tech-large:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.feature-card {
    height: 100%;
    padding: 24px;

    background: var(--project-card-bg);
    border: 1px solid var(--project-border);

    border-radius: 16px;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.feature-card > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    margin-bottom: 18px;

    color: var(--accent-color);
    background: var(--accent-soft);

    border-radius: 12px;

    font-size: 1.25rem;
}

.feature-card h5 {
    color: var(--text-main);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-sub);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.case-card {
    height: 100%;
    padding: 28px;

    background: var(--project-card-bg);
    border: 1px solid var(--project-border);

    border-radius: 18px;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.case-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.case-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    margin-bottom: 18px;

    color: var(--accent-color);
    background: var(--accent-soft);

    border-radius: 14px;

    font-size: 1.35rem;
}

.case-card h3 {
    color: var(--text-main);
}

.case-card p {
    color: var(--text-sub);
}

@media (max-width: 767.98px) {

    .project-detail-section {
        padding-top: 105px;
    }

    .project-detail-section h1 {
        font-size: 2.1rem;
    }

    .project-info-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .project-info-item strong {
        text-align: left;
    }

    .project-preview-body {
        min-height: 220px;
    }

    .case-card {
        padding: 24px;
    }

    .technology-section {
        padding: 24px;
    }

    .project-navigation {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .project-navigation .btn {
        width: 100%;
    }

    .language-button {
        min-width: 78px;
        height: 38px;
    }

}

/* Toast Container */
.toast-container { z-index: 1090; }

/* Mobile Timeline Adjustments */
@media (max-width: 991px) {
    .timeline-wrapper {
        flex-direction: column;
        gap: 24px;
    }
    .timeline-wrapper::before {
        top: 0;
        bottom: 0;
        left: 23px;
        width: 2px;
        height: 100%;
    }
    .timeline-item {
        display: flex;
        gap: 16px;
        align-items: flex-start;
    }
    .step-number {
        flex-shrink: 0;
        margin-bottom: 0;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
