/* 
 * Isotify Core Design System
 * Focus: Professional, Trustworthy, Corporate
 */

:root {
    /* Colors */
    --primary: #0F172A;
    /* Deep Navy */
    --primary-light: #1E293B;
    --secondary: #2563EB;
    /* Professional Azure Blue */
    --accent: #3B82F6;
    --accent-light: #60A5FA;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Neutrals */
    --white: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-gradient: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
    --grey-100: #F1F5F9;
    --grey-200: #E2E8F0;
    --grey-300: #CBD5E1;
    --grey-600: #475569;
    --grey-800: #1E293B;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --gradient-accent: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #60A5FA 100%);
    --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #0F172A 100%);
    --gradient-section: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
    --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Georgia", serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Shadows - Enhanced for depth */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.15);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-blur: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 12px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--grey-800);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.25rem;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--space-sm);
    color: var(--grey-600);
    font-size: 1.125rem;
}

/* Layout Components */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
    position: relative;
}

.section-alt {
    background: var(--gradient-section);
    border-top: 1px solid var(--grey-200);
    border-bottom: 1px solid var(--grey-200);
}

/* Header & Navigation */
header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    /* Enhanced institutional presence */
    width: auto;
    display: block;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    margin-bottom: var(--space-sm);
    display: inline-block;
}

.footer-logo span {
    color: var(--secondary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-md);
    align-items: center;
    /* Ensures perfect vertical centering with logo */
}

nav ul li a {
    text-decoration: none;
    color: var(--grey-600);
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

nav ul li a:hover {
    color: var(--secondary);
}

/* UI Elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

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

.btn-outline:hover {
    background: var(--secondary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

/* Cards - Enhanced */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    border: none;
    background: none;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    transition: all 0.3s ease;
}

/* Mobile Header Refinement */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: auto;
        max-height: calc(100vh - var(--header-height));
        background: var(--white);
        display: none !important;
        /* Force hide on mobile */
        flex-direction: column;
        padding: var(--space-md);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    nav.active {
        display: flex !important;
        /* Show when active */
    }

    nav ul {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 100%;
        padding: 0;
    }

    nav ul li {
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        font-size: 1.25rem;
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid var(--grey-100);
        width: 100%;
    }

    .nav-content {
        padding: 0 var(--space-md);
    }

    .logo img {
        height: 40px;
    }

    /* Blocks & Text Responsiveness */
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr !important;
    }

    h1 {
        font-size: 2.25rem !important;
    }

    h2 {
        font-size: 1.85rem !important;
    }

    .hero {
        text-align: center;
        padding: 4rem 0;
    }

    .hero-btns {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 300px;
    }

    .hero-image-bg {
        display: none;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.6rem !important;
    }

    p {
        font-size: 1.05rem;
    }

    .container {
        padding: 0 var(--space-sm);
    }

    .section {
        padding: 3rem 0;
    }
}

/* =============================================
   Component Styles (Consolidated from Page Internals)
   ============================================= */

/* Hero Section - Enhanced */
.hero {
    position: relative;
    background: var(--gradient-hero);
    color: var(--white);
    padding: var(--space-xl) 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 80vh;
}

/* Decorative gradient mesh overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(30, 58, 95, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Decorative accent circle */
.hero::after {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: var(--space-sm);
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    color: var(--grey-300);
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.hero-image-bg {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    height: 90%;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    opacity: 0.9;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-btns {
    display: flex;
    gap: var(--space-sm);
}

/* Page Header (Sub-pages) - Enhanced */
.page-header {
    background: var(--gradient-hero);
    color: var(--white);
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 90%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.page-header h1 {
    color: var(--white);
    margin: 0;
    font-size: 3rem;
    line-height: 1.2;
    position: relative;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.page-header p {
    color: var(--grey-300);
    margin-top: 15px;
    font-size: 1.2rem;
    max-width: 800px;
    position: relative;
}

.page-header.center {
    text-align: center;
}

/* Sticky CTA Bar */
.sticky-cta {
    background: linear-gradient(180deg, var(--grey-100) 0%, var(--white) 100%);
    padding: 20px 0;
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: var(--header-height);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Trust Bar - Enhanced */
.trust-bar {
    background: linear-gradient(180deg, var(--grey-100) 0%, var(--white) 100%);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--grey-200);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    text-align: center;
}

.trust-item {
    font-weight: 600;
    color: var(--grey-600);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Module Grid (Course Pages) */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.module-card {
    background: white;
    border: 1px solid var(--grey-200);
    padding: 30px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

/* Career Page Steps */
.career-step {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 8px;
}

.step-number {
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* About Page Vision Section */
.vision-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-xl);
    align-items: start;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
}

.stat-item h3 {
    color: var(--secondary);
    font-size: 2rem;
    margin-bottom: 5px;
}

/* Contact Page Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-xl);
    margin-top: 50px;
    align-items: start;
}

.support-card {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--grey-200);
}

.support-card h3 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

/* Page-specific custom boxes */
.haccp-box {
    border: 1px solid var(--secondary);
    background: rgba(37, 99, 235, 0.05);
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
}

.security-audit-card {
    background: var(--grey-100);
    border-left: 5px solid var(--secondary);
    padding: 30px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.knowledge-item {
    margin-bottom: 30px;
}

.knowledge-item h3 {
    color: var(--primary);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
    padding-bottom: 5px;
}

/* =============================================
   Additional Responsive Rules for Consolidated Components
   ============================================= */
@media (max-width: 992px) {
    .hero-content {
        max-width: 100%;
        text-align: center;
    }

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

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .vision-section {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }
}

/* Footer */
footer {
    background-color: var(--primary);
    color: var(--white);
    padding: var(--space-xl) 0 var(--space-md);
}

footer p {
    color: var(--grey-300);
}

footer h3 {
    color: var(--white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links li a {
    color: var(--grey-300);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links li a:hover {
    color: var(--white);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-sm);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--grey-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}