@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #0000FF;
    --primary-dark: #0000CC;
    --primary-light: #3333FF;
    --secondary: #000000;
    --bg: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-section: #FAFBFC;
    --text: #1A1A1A;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #E5E7EB;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 8px 24px rgba(0, 0, 255, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-dark: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 1);
}

nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: transform 0.2s;
}

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

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

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

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

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

/* Hero Section */
.hero {
    padding: 180px 2rem 60px;
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 0, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    position: relative;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 2rem;
    font-weight: 400;
    line-height: 1.6;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Feature Sections */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.section-alt {
    background: var(--bg-section);
}

.section-dark {
    background: var(--gradient-dark);
    color: white;
}

.section-dark h2,
.section-dark h3 {
    color: white;
}

.section-dark p {
    color: #ccc;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.7;
}

.section-dark .section-header p {
    color: #bbb;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 16px 36px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 255, 0.3);
    background: var(--primary-dark);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
    background: #1a1a1a;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Container & Grid */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.feature-card {
    text-align: center;
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
    margin: 4rem 0;
}

.stat-item h3 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--bg);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--secondary);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle svg {
    width: 22px;
    height: 22px;
}

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent);
    color: var(--primary-dark);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-light);
}

.file-upload-label:hover {
    border-color: var(--primary);
    background: rgba(0, 0, 255, 0.02);
}

.file-upload-input {
    display: none;
}

.file-upload-text {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    padding: 5rem 2rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.15rem;
}

.footer-col p {
    color: #aaa;
    line-height: 1.8;
}

.footer-col a {
    display: block;
    color: #aaa;
    text-decoration: none;
    margin-bottom: 0.8rem;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-col a:hover {
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visible {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Responsive */
/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
    color: var(--text);
}

.mobile-menu-btn svg {
    width: 28px;
    height: 28px;
}

/* Mobile Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 900px) {

    /* Show mobile menu button on tablet and smaller */
    .mobile-menu-btn {
        display: block;
    }

    /* Mobile Navigation */
    .nav-links,
    .discussion-nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 5rem 2rem 2rem;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        gap: 0;
    }

    .nav-links.active,
    .discussion-nav-menu.active {
        right: 0;
    }

    /* Adjust list items for mobile */
    .nav-links li,
    .discussion-nav-menu li {
        width: 100%;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    .nav-links.active li,
    .discussion-nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger animation for items */
    .nav-links.active li:nth-child(1),
    .discussion-nav-menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2),
    .discussion-nav-menu.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3),
    .discussion-nav-menu.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4),
    .discussion-nav-menu.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links.active li:nth-child(5),
    .discussion-nav-menu.active li:nth-child(5) {
        transition-delay: 0.5s;
    }

    .nav-links.active li:nth-child(6),
    .discussion-nav-menu.active li:nth-child(6) {
        transition-delay: 0.6s;
    }



    .nav-links a,
    .discussion-nav-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1.15rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .nav-links a:hover::after,
    .nav-links a.active::after,
    .discussion-nav-menu a:hover::after,
    .discussion-nav-menu a.active::after {
        width: 0;
        /* Disable underline animation on mobile */
    }

    .nav-links a:hover,
    .discussion-nav-menu a:hover {
        padding-left: 10px;
        /* Slide effect on hover */
    }

    /* User Profile in Menu */
    #auth-links {
        width: 100%;
        margin-top: 1rem;
    }

    .user-menu-container {
        width: 100%;
        display: block !important;
    }

    .user-dropdown {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        background: var(--bg-light) !important;
        padding: 0 !important;
        display: block !important;
        /* Always show links in mobile if logged in */
        margin-top: 0.5rem;
    }

    /* General Layout Adjustments */
    .hero {
        padding: 140px 1.5rem 60px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Calculator Grid Buttons */
.calc-button {
    display: block;
    padding: 1.5rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 255, 0.15);
}

.calc-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 255, 0.25);
    background: var(--primary-dark);
}

/* Bottom Action Bar for Calculators */
.calc-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.calc-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.btn-clear {
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #E5E7EB;
}

.btn-clear:hover {
    background: #E5E7EB;
    color: #1F2937;
}

.btn-export {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 255, 0.2);
}

.btn-export:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 255, 0.3);
}

/* Print Styles */
@media print {

    /* Hide non-printable elements */
    header,
    nav,
    .navbar,
    .topbar,
    .app-header p,
    footer,
    .calc-actions,
    .print-hide {
        display: none !important;
    }

    /* Reset body styles for print */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    /* Ensure container takes full width */
    .calc-container,
    .container,
    .wrap {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Card styling removal for print */
    .calc-card,
    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Ensure inputs look like text */
    input,
    select,
    textarea {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        font-weight: bold;
        color: black !important;
        -webkit-appearance: none;
        appearance: none;
    }

    /* Add a print header */
    .calc-container::before {
        content: "pen and papper Engineering Report";
        display: block;
        font-size: 18pt;
        font-weight: bold;
        color: #0000FF;
        margin-bottom: 10px;
        border-bottom: 2px solid #0000FF;
        padding-bottom: 5px;
    }

    /* Ensure tables print well */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th,
    td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
    }

    /* Page break handling */
    .page-break {
        page-break-before: always;
    }
}