/*
 * Uncle Ted - Main Stylesheet
 * Version: 1.0
 * Author: Hamoon Soleimani (Generated by AI Assistant)
 * Description: A unified stylesheet for the Uncle Ted project, 
 *              combining a dark, cyber-tech aesthetic with modern
 *              web design principles.
 */

/* --- TABLE OF CONTENTS ---
1.  :root Variables & Theming
2.  CSS Reset & Base Styles
3.  General Typography & Layout
4.  Animations (Glitch, Fade-in)
5.  Header & Navigation
6.  Hero Section
7.  Core Content Sections
8.  Feature Grids & Cards
9.  "God Mode" Section Styling
10. Page-Specific Elements
    - Tech Stack (index.html)
    - Disclaimer Box
    - Tutorial Page Elements
11. Footer
12. Media Queries (Responsiveness)
*/


/* --- 1. :root Variables & Theming --- */
:root {
    --color-background: #0A0A0B;      /* Deep, near-black for high contrast */
    --color-surface-1: #141416;       /* Primary surface color for cards */
    --color-surface-2: #1F1F23;       /* Secondary, lighter surface */
    --color-primary: #FF3C3C;         /* A vibrant, dangerous red */
    --color-accent: #00FF9C;          /* A sharp, digital green */
    --color-text-primary: #EAEAEA;    /* Main text color */
    --color-text-secondary: #9A9A9A;  /* Subdued text for paragraphs */
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-glow: rgba(0, 255, 156, 0.3);

    --glow-primary: 0 0 15px rgba(255, 60, 60, 0.5);
    --glow-accent: 0 0 15px rgba(0, 255, 156, 0.4);
    
    --font-display-en: 'Exo 2', sans-serif;
    --font-body-en: 'Roboto Mono', monospace;
    --font-persian: 'Vazirmatn', sans-serif;
    
    --header-height: 70px;
    --border-radius: 8px;
}

/* --- 2. CSS Reset & Base Styles --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Language-specific font application */
html[lang="en"] body { font-family: var(--font-body-en); }
html[lang="fa"] body { font-family: var(--font-persian); }

body.nav-open {
    overflow: hidden;
}

/* --- 3. General Typography & Layout --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 0;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    color: var(--color-text-primary);
    font-weight: 700;
}

html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] h4 { font-family: var(--font-display-en); }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4 { font-family: var(--font-persian); }

h1 { font-size: 2.5rem; text-transform: uppercase; }
h2 { font-size: 2.2rem; text-transform: uppercase; margin-bottom: 40px; position: relative; padding-bottom: 15px; border-bottom: 1px solid var(--color-border); }
h3 { font-size: 1.3rem; margin-bottom: 15px; letter-spacing: 1px; }
h4 { font-size: 1.1rem; color: var(--color-accent); margin-top: 30px; margin-bottom: 15px; font-weight: 700; letter-spacing: 0.5px; }

h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
}
html[dir="rtl"] h2::after { right: 0; left: auto; background: linear-gradient(-90deg, var(--color-primary), transparent); }

p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
    font-size: 1rem;
}

.text-accent { color: var(--color-accent); }
.text-danger { color: var(--color-primary); }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: #fff; }

.cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 60, 60, 0.3);
}
html[lang="en"] .cta-button { font-family: var(--font-display-en); }
html[lang="fa"] .cta-button { font-family: var(--font-persian); }

.cta-button:hover {
    transform: translateY(-5px);
    background: #ff5555;
    box-shadow: var(--glow-primary);
}

/* --- 4. Animations (Glitch, Fade-in) --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.glitch {
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,60,60,.75),-0.025em -0.05em 0 rgba(0,255,156,.75),0.025em 0.05em 0 rgba(0,0,255,.75);
    animation: glitch 500ms infinite;
}
.glitch span { position: absolute; top: 0; left: 0; }
.glitch span:first-child { animation: glitch 650ms infinite; clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); transform: translate(-0.025em, -0.0125em); opacity: 0.8; }
.glitch span:last-child { animation: glitch 375ms infinite; clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); transform: translate(0.0125em, 0.025em); opacity: 0.8; }

@keyframes glitch { 0%{text-shadow:0.05em 0 0 rgba(255,0,0,.75),-0.05em -0.025em 0 rgba(0,255,0,.75),-0.025em 0.05em 0 rgba(0,0,255,.75)}14%{text-shadow:0.05em 0 0 rgba(255,0,0,.75),-0.05em -0.025em 0 rgba(0,255,0,.75),-0.025em 0.05em 0 rgba(0,0,255,.75)}15%{text-shadow:-0.05em -0.025em 0 rgba(255,0,0,.75),0.025em 0.025em 0 rgba(0,255,0,.75),-0.05em -0.05em 0 rgba(0,0,255,.75)}49%{text-shadow:-0.05em -0.025em 0 rgba(255,0,0,.75),0.025em 0.025em 0 rgba(0,255,0,.75),-0.05em -0.05em 0 rgba(0,0,255,.75)}50%{text-shadow:0.025em 0.05em 0 rgba(255,0,0,.75),0.05em 0 0 rgba(0,255,0,.75),0 -0.05em 0 rgba(0,0,255,.75)}99%{text-shadow:0.025em 0.05em 0 rgba(255,0,0,.75),0.05em 0 0 rgba(0,255,0,.75),0 -0.05em 0 rgba(0,0,255,.75)}100%{text-shadow:-0.025em 0 0 rgba(255,0,0,.75),-0.025em -0.05em 0 rgba(0,255,0,.75),-0.05em -0.025em 0 rgba(0,0,255,.75)}}

@keyframes fadeInGlow {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); filter: drop-shadow(var(--glow-primary)); }
}

/* --- 5. Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 5%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 11, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s ease;
}

.logo img {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}
.logo:hover img { transform: scale(1.05); }

.header-controls { display: flex; align-items: center; gap: 15px; }

/* Mobile Navigation Toggle */
.nav-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
    order: 2;
}
.hamburger { display: block; position: relative; width: 24px; height: 2px; background: var(--color-text-primary); transition: all 0.3s ease-in-out; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; width: 24px; height: 2px; background: var(--color-text-primary); transition: all 0.3s ease-in-out; }
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }
body.nav-open .hamburger { background: transparent; }
body.nav-open .hamburger::before { transform: translateY(8px) rotate(45deg); }
body.nav-open .hamburger::after { transform: translateY(-8px) rotate(-45deg); }
html.nav-open .hamburger { background: transparent; } /* For tutorial page */
html.nav-open .hamburger::before { transform: translateY(8px) rotate(45deg); }
html.nav-open .hamburger::after { transform: translateY(-8px) rotate(-45deg); }


/* Navigation Menu */
.main-nav {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 11, 0.98);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
body.nav-open .main-nav, html.nav-open .main-nav { transform: translateX(-100%); }
html[dir="rtl"] .main-nav { left: auto; right: 100%; }
html[dir="rtl"].nav-open .main-nav { transform: translateX(100%); }

.main-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 1.5rem;
    margin: 20px 0;
    padding: 5px 10px;
    font-weight: 700;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
html[lang="en"] .main-nav a { font-family: var(--font-display-en); }
html[lang="fa"] .main-nav a { font-family: var(--font-persian); }

.main-nav a:hover { color: var(--color-text-primary); text-shadow: 0 0 5px var(--glow-accent); }

/* --- 6. Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: var(--header-height) 15px 0;
    background-color: var(--color-background);
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 25px 25px;
}
.hero-content {
    z-index: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInGlow 2s ease-in-out;
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
}
.hero p {
    font-size: 1rem;
    max-width: 550px;
    margin: 20px auto 40px;
    color: var(--color-text-secondary);
}

/* --- 7. Core Content Sections --- */
section { 
    background-color: var(--color-background); 
    border-bottom: 1px solid var(--color-border); 
}
#philosophy, #god-mode {
    background-color: var(--color-surface-1);
}
section:last-of-type { 
    border-bottom: none; 
}

.philosophy-content { 
    text-align: center; 
    max-width: 800px; 
    margin: 0 auto; 
}
.philosophy-content blockquote {
    font-size: 1.1rem;
    font-style: italic;
    border-left: 3px solid var(--color-primary);
    padding-left: 20px;
    margin: 40px 0;
    text-align: left;
    color: var(--color-text-primary);
}
html[lang="en"] .philosophy-content blockquote { font-family: var(--font-display-en); }
html[dir="rtl"] .philosophy-content blockquote { border-left: none; border-right: 3px solid var(--color-primary); padding-left: 0; padding-right: 20px; text-align: right; }

/* --- 8. Feature Grids & Cards --- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 50px;
}
.feature-card {
    background: var(--color-surface-1);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
/* Unified hover effect from tutorial page */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% -100%, rgba(0, 255, 156, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-glow);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon { margin-bottom: 20px; }
.feature-icon svg { width: 40px; height: 40px; stroke: var(--color-accent); }
.feature-card h3 { color: var(--color-text-primary); margin-bottom: 10px; }
.feature-card p, .feature-card ul { font-size: 0.95rem; margin-bottom: 0; }
.feature-card ul li { padding-left: 20px; margin-bottom: 8px; font-size: 0.9rem; }
html[dir="rtl"] .feature-card ul li { padding-left: 0; padding-right: 20px; }

/* --- 9. "God Mode" Section Styling --- */
#god-mode {
    background-image:
        linear-gradient(rgba(255, 60, 60, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 60, 60, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}
.god-mode-container {
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius);
    padding: 30px;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: inset 0 0 20px rgba(255, 60, 60, 0.2), var(--glow-primary);
}
.god-mode-container h2::after { background: linear-gradient(90deg, var(--color-accent), transparent); }
html[dir="rtl"] .god-mode-container h2::after { background: linear-gradient(-90deg, var(--color-accent), transparent); }
.god-mode-container .feature-card { background-color: var(--color-background); border-color: rgba(255, 60, 60, 0.3); }
.god-mode-container .feature-card:hover { border-color: var(--color-primary); }
.god-mode-container .feature-card::before { background: radial-gradient(circle at 50% -100%, rgba(255, 60, 60, 0.15), transparent 70%); }

/* --- 10. Page-Specific Elements --- */

/* Tech Stack (index.html) */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    justify-content: center;
}
.tech-item {
    background: var(--color-surface-2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 400;
    border: 1px solid var(--color-border);
}

/* Disclaimer Box (Shared) */
.disclaimer-box {
    background: var(--color-surface-1);
    border: 1px solid var(--color-primary);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: inset 0 0 15px rgba(255, 60, 60, 0.15);
}
.disclaimer-box h3 { color: var(--color-primary); margin-bottom: 15px; }

/* Download Section (index.html) */
#download { text-align: center; }
#download p { max-width: 600px; margin-left: auto; margin-right: auto; }

/* -- Tutorial Page Elements -- */
code {
    font-family: var(--font-body-en);
    background-color: rgba(0, 255, 156, 0.1);
    border: 1px solid rgba(0, 255, 156, 0.2);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--color-accent);
    direction: ltr;
    display: inline-block;
}
pre {
    background-color: var(--color-surface-1);
    border: 1px solid var(--color-border);
    padding: 2em 1.5em 1.5em;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
    direction: ltr;
    text-align: left;
}
pre::before {
    content: 'COMMAND';
    position: absolute;
    top: 0;
    left: 0;
    padding: 4px 12px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: var(--border-radius) 0 var(--border-radius) 0;
}
pre code { background: none; border: none; padding: 0; font-size: 0.9rem; line-height: 1.6; }

ol li, .tutorial-list ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    color: var(--color-text-secondary);
}
ol li::before, .tutorial-list ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
    font-family: var(--font-body-en);
    font-size: 1.2rem;
    top: -3px;
}
html[dir="rtl"] ol li, html[dir="rtl"] .tutorial-list ul li { padding-left: 0; padding-right: 30px; }
html[dir="rtl"] ol li::before, html[dir="rtl"] .tutorial-list ul li::before { right: 0; left: auto; }

.tutorial-image-container {
    background-color: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 10px;
    margin: 30px auto;
    text-align: center;
    max-width: 350px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.tutorial-image-container img { max-width: 100%; height: auto; border-radius: 4px; }
.image-caption { font-size: 0.85rem; font-style: italic; color: var(--color-text-secondary); margin-top: 10px; margin-bottom: 0; }

.lang-toggle { display: flex; align-items: center; order: 1; }
.lang-toggle button {
    background: none; border: none; color: var(--color-text-secondary);
    font-family: var(--font-body-en); font-size: 1rem; cursor: pointer;
    transition: color 0.3s ease; padding: 0 8px;
}
.lang-toggle button.active, .lang-toggle button:hover { color: var(--color-accent); }
.lang-toggle span { color: var(--color-text-secondary); opacity: 0.5; }


/* --- 11. Footer --- */
.main-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-surface-1);
}
.footer-links { margin-bottom: 20px; }
.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-links a:hover { color: var(--color-text-primary); text-shadow: 0 0 5px rgba(255,255,255,0.5); }
.footer-copy { font-size: 0.9rem; color: var(--color-text-secondary); opacity: 0.7; }

/* --- 12. Media Queries (Responsiveness) --- */

/* --- TABLET STYLES --- */
@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.2rem; }
    
    .nav-toggle { display: none; }
    .main-nav {
        position: static;
        transform: none;
        flex-direction: row;
        height: auto;
        width: auto;
        background: transparent;
        backdrop-filter: none;
    }
    .main-nav a {
        font-size: 1rem;
        margin: 0 0 0 20px;
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0.5px;
        color: var(--color-text-secondary);
    }
    html[dir="rtl"] .main-nav a { margin: 0 20px 0 0; }
    .main-nav a:hover { color: var(--color-accent); text-shadow: 0 0 8px var(--glow-accent); }
    .header-controls { gap: 30px; }

    .hero h1 { font-size: 4.5rem; }
    .hero p { font-size: 1.1rem; }
    .hero-logo { max-width: 250px; }

    .features-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .god-mode-container .features-grid { grid-template-columns: repeat(2, 1fr); }
    
    .footer-links { margin-bottom: 0; display: inline-block; }
    .footer-copy { display: inline-block; margin-left: 20px; }
}

/* --- DESKTOP STYLES --- */
@media (min-width: 1024px) {
    .container { padding: 100px 0; }
    h1 { font-size: 4rem; }
    h2 { font-size: 2.5rem; margin-bottom: 40px;}
    h2::after { width: 80px; height: 4px; }

    .hero h1 { font-size: 6rem; }
    .hero p { font-size: 1.2rem; margin: 20px auto 40px; }
    .hero-logo { max-width: 300px; }
    .cta-button { padding: 16px 40px; font-size: 1.2rem; }

    .philosophy-content blockquote { font-size: 1.2rem; }
    .feature-card { padding: 30px; }
    .feature-card:hover { transform: translateY(-10px); }
    .feature-icon svg { width: 48px; height: 48px; }
    .god-mode-container { padding: 40px; }
    .god-mode-container .features-grid { grid-template-columns: repeat(3, 1fr); }
    .tech-stack { justify-content: flex-start; }
}