/* ============================================
   ProjectTracker Landing Page Styles
   Modern Dark Theme
   ============================================ */

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-card: #242b3d;
    --bg-card-hover: #2d3548;
    --border-color: #334155;
    
    --accent-blue: #5b8def;
    --accent-blue-hover: #7ba8f7;
    --accent-green: #10b981;
    --accent-purple: #a855f7;
    --accent-orange: #f97316;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --gradient-blue: linear-gradient(135deg, #5b8def 0%, #4a6fd4 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body.loading {
    opacity: 0;
}

body.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 1002;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-card-hover);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.2s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.btn-nav {
    background: var(--gradient-blue);
    color: white !important;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-nav::after {
    display: none;
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.4);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn i {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(91, 141, 239, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(91, 141, 239, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-download {
    background: var(--gradient-green);
    color: white;
    padding: 16px 32px;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 160px 0 100px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(91, 141, 239, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 24px;
    max-width: 100%;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease;
    cursor: default;
}

.stat:hover {
    transform: scale(1.05);
}

.stat-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-blue);
    transition: color 0.3s ease;
}

.stat:hover .stat-icon {
    color: var(--accent-blue-hover);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* App Preview */
.app-preview {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.app-preview:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(91, 141, 239, 0.2);
}

.preview-header {
    background: var(--bg-secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
}

.preview-dots span:first-child { background: #ef4444; }
.preview-dots span:nth-child(2) { background: #f59e0b; }
.preview-dots span:last-child { background: #10b981; }

.preview-title {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.preview-content {
    display: flex;
    padding: 20px;
    gap: 16px;
    min-height: 300px;
}

.preview-sidebar {
    width: 60px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.preview-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    height: 80px;
    animation: pulse 2s ease-in-out infinite;
}

.preview-card.small {
    height: 60px;
    width: 60%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
    box-shadow: 0 12px 40px rgba(91, 141, 239, 0.15);
}

.feature-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-blue);
    margin-bottom: 16px;
    display: inline-block;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--accent-blue-hover);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   Download Section
   ============================================ */
.download {
    padding: 100px 0;
    background: var(--bg-primary);
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 24px;
}

.download-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.download-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-blue);
}

.download-details h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin-bottom: 4px;
}

.download-details p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.version-badge {
    background: var(--accent-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.requirements {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.requirements h4 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.requirements ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.requirements li {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirements li i {
    width: 20px;
    height: 20px;
    color: var(--accent-green);
    flex-shrink: 0;
}

/* ============================================
   Setup Section
   ============================================ */
.setup {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.steps {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.step {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 60px;
    bottom: -20px;
    width: 2px;
    background: var(--border-color);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 100%;
    overflow: hidden;
}

.step-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.step-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.step-link {
    background: var(--bg-secondary);
    color: var(--accent-blue);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.step-link i {
    width: 18px;
    height: 18px;
}

.step-link:hover {
    background: var(--accent-blue);
    color: white;
}

.step-link:hover i {
    color: white;
}

.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.code-block code,
.code-block pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--accent-green);
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
    display: block;
}

.step-note {
    background: rgba(91, 141, 239, 0.1);
    border-left: 3px solid var(--accent-blue);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-note i {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.step-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step-success i {
    width: 20px;
    height: 20px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand .logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-blue);
}

.footer-brand .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a i {
    width: 18px;
    height: 18px;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 32px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-image {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .download-card {
        justify-content: center;
        text-align: center;
    }
    
    .download-info {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .navbar {
        padding: 12px 0;
    }
    
    .navbar .container {
        flex-direction: row;
    }
    
    .logo {
        z-index: 1002;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 24px 24px;
        gap: 24px;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        width: 100%;
        padding: 12px 0;
        font-size: 1.1rem;
    }
    
    .btn-nav {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .hero {
        padding: 120px 0 60px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat:hover {
        transform: none;
    }
    
    .hero-image {
        display: none;
    }
    
    .features,
    .download,
    .setup {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 40px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .download-card {
        flex-direction: column;
        padding: 24px;
    }
    
    .download-info {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-download {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .requirements {
        padding: 24px;
    }
    
    .requirements ul {
        grid-template-columns: 1fr;
    }
    
    .step {
        gap: 16px;
    }
    
    .step:not(:last-child)::after {
        left: 20px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-content {
        padding: 20px;
        overflow: hidden;
        max-width: 100%;
    }
    
    .step-content h3 {
        font-size: 1.1rem;
        word-wrap: break-word;
    }
    
    .step-content p {
        word-wrap: break-word;
    }
    
    .code-block {
        padding: 12px;
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-block code,
    .code-block pre {
        font-size: 0.8rem;
        white-space: pre-wrap;
        word-break: break-all;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .download-icon {
        width: 48px;
        height: 48px;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .stat {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .preview-content {
        padding: 12px;
        min-height: 200px;
    }
    
    .preview-sidebar {
        width: 40px;
    }
    
    .preview-card {
        height: 60px;
    }
    
    .preview-card.small {
        height: 40px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .step {
        gap: 12px;
    }
    
    .step-content {
        padding: 16px;
    }
    
    .code-block {
        padding: 10px;
        font-size: 0.75rem;
        margin: 8px 0;
    }
    
    .code-block code,
    .code-block pre {
        font-size: 0.7rem;
    }
    
    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .step:not(:last-child)::after {
        left: 17px;
    }
}

/* ============================================
   Accessibility & Performance
   ============================================ */
@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;
    }
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Prevent horizontal scroll on all elements */
section,
.container,
.hero,
.features,
.download,
.setup,
.footer {
    max-width: 100%;
    overflow-x: hidden;
}

/* Additional overflow protection */
.step-content *,
.code-block *,
.requirements *,
.download-card * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure pre and code don't cause overflow */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

code {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
