/* Reset and Base Variables */
:root {
    --bg-color: #0f1115;
    --card-bg: #181c24;
    --text-primary: #e3e6ed;
    --text-secondary: #9aa0a6;
    --accent-blue: #00adb5;
    --accent-green: #00ff87;
    --accent-dark: #1f232d;
    --border-color: #2d3139;
    --header-bg: rgba(15, 17, 21, 0.85);
    
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans CJK SC", "Source Han Sans CN", sans-serif;
    --font-code: "Fira Code", "Consolas", Monaco, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--accent-blue);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu li a {
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu li a:hover {
    color: var(--accent-blue);
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    z-index: 1;
}

.dropdown-content a {
    padding: 10px 20px;
    display: block;
    color: var(--text-secondary);
}

.dropdown-content a:hover {
    background-color: var(--accent-dark);
    color: var(--accent-blue);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Hamburger menu */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

/* Home Page */
.home-page {
    margin-top: 70px;
}

.hero-section {
    position: relative;
    padding: 120px 20px;
    text-align: center;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 25px;
    font-weight: 800;
}

.hero-title .highlight {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--accent-blue);
    color: #fff;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
}

.primary-btn:hover {
    background: transparent;
    color: var(--accent-blue);
    box-shadow: 0 4px 20px rgba(0, 173, 181, 0.5);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.secondary-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Background Animation */
.hero-background-animation {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #151821 0%, var(--bg-color) 70%);
    z-index: 1;
    opacity: 0.8;
}

.matrix-grid {
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(0, 173, 181, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 173, 181, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    position: absolute;
    top: -50%; left: -50%;
    transform: rotateX(60deg) rotateZ(0deg);
    transform-origin: center center;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: rotateX(60deg) rotateZ(0deg) translateY(0); }
    100% { transform: rotateX(60deg) rotateZ(0deg) translateY(40px); }
}

/* Sections */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.section-title {
    font-size: 32px;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.accent-line {
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-blue);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.language-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.language-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 173, 181, 0.15);
    border-color: rgba(0, 173, 181, 0.4);
}

.lang-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.lang-name {
    font-size: 18px;
    font-weight: 600;
}

.lang-overlay {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(0deg, var(--accent-blue), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: bottom 0.3s ease;
    opacity: 0;
}

.lang-overlay span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.language-card:hover .lang-overlay {
    bottom: 0;
    opacity: 0.9;
}

/* Featured Section */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.featured-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    border-top: 4px solid var(--accent-blue);
}

.f-card-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.f-card-title {
    font-size: 22px;
    margin-bottom: 15px;
}

.featured-card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 25px;
}

.f-card-link {
    color: var(--accent-green);
    font-weight: 600;
    transition: color 0.3s;
}

.f-card-link:hover {
    color: #fff;
}

/* About Box */
.about-box {
    background: linear-gradient(135deg, var(--card-bg) 0%, #151821 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 60px;
    text-align: center;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.about-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--accent-blue);
}

.about-box p {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 15px;
    font-size: 16px;
}

/* Language Page Container */
.lang-page-container {
    margin-top: 70px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    padding: 60px 20px;
}

.lang-header {
    text-align: center;
    margin-bottom: 60px;
}

.lang-title {
    font-size: 40px;
    margin-bottom: 10px;
    color: #fff;
}

.lang-subtitle {
    color: var(--accent-blue);
    font-size: 18px;
    letter-spacing: 1px;
}

/* Code Examples List */
.code-examples-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.example-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.example-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
}

/* Mac-like window */
.code-section {
    background: #1e1e1e; /* VS Code dark */
    position: relative;
    border-right: 1px solid var(--border-color);
}

.mac-window-controls {
    background: #252526;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.window-title {
    margin-left: 10px;
    font-family: var(--font-code);
    font-size: 13px;
    color: #858585;
}

.code-section pre {
    margin: 0 !important;
    padding: 20px !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 14px;
    overflow-x: auto;
    max-height: 500px;
}

.code-section code {
    font-family: var(--font-code);
    line-height: 1.6;
}

/* Description Section */
.desc-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, var(--card-bg) 0%, #151821 100%);
}

.desc-title {
    font-size: 24px;
    margin-bottom: 25px;
    color: #fff;
    line-height: 1.4;
}

.accent-number {
    color: var(--accent-blue);
    font-size: 28px;
    margin-right: 8px;
    font-weight: 800;
}

.desc-content {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.desc-content code {
    background: rgba(0, 173, 181, 0.1);
    color: var(--accent-green);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 14px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-color);
    margin-top: 60px;
}

.footer-content p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 14px;
}

.icp-info a {
    color: var(--accent-blue);
    font-size: 13px;
    transition: color 0.3s;
}

.icp-info a:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 992px) {
    .example-layout {
        grid-template-columns: 1fr;
    }
    
    .code-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .desc-section {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 16px; }
    
    .hamburger { display: flex; }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--header-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.5);
        padding: 20px 0;
    }
    
    .nav-menu.active { left: 0; }
    
    .nav-menu li { margin: 15px 0; }
    
    .dropdown-content {
        position: static;
        display: none;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
}
