/* ==========================================
   CAD-SIGNet - Modern Research Page Styles
   ========================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables for theming */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #7209b7;
    --accent-color: #f72585;
    --accent-secondary: #4cc9f0;

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #6c6c8a;

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-tertiary: #eef1f8;

    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #7209b7 50%, #f72585 100%);
    --gradient-subtle: linear-gradient(135deg, #f8f9fc 0%, #eef1f8 100%);
    --gradient-hero: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);

    --shadow-sm: 0 2px 8px rgba(67, 97, 238, 0.08);
    --shadow-md: 0 4px 20px rgba(67, 97, 238, 0.12);
    --shadow-lg: 0 8px 40px rgba(67, 97, 238, 0.15);
    --shadow-glow: 0 0 40px rgba(67, 97, 238, 0.2);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
body.dark-mode {
    --text-primary: #f0f0f5;
    --text-secondary: #b8b8d0;
    --text-muted: #8888a8;

    --bg-primary: #0d0d1a;
    --bg-secondary: #151528;
    --bg-tertiary: #1e1e38;

    --gradient-subtle: linear-gradient(135deg, #151528 0%, #1e1e38 100%);
    --gradient-hero: linear-gradient(180deg, #151528 0%, #0d0d1a 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(67, 97, 238, 0.3);
}

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Laptop Styles */
@media (min-width: 1024px) {
    body {
        margin: 0;
        padding: 40px 15%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    body {
        margin: 0;
        padding: 30px 8%;
    }
}

/* Phone Styles */
@media (max-width: 767px) {
    body {
        margin: 0;
        padding: 20px 5%;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.65rem, 3.5vw, 2.2rem);
}

h3 {
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    font-weight: 500;
}

p {
    font-size: 22px;
    color: var(--text-secondary);
    margin-bottom: 1.2em;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--accent-color);
}

/* Header */
header {
    text-align: center;
    padding: 60px 0 40px;
    background: var(--gradient-hero);
    margin: -40px -15% 0;
    padding-left: 15%;
    padding-right: 15%;
    position: relative;
}

@media (max-width: 1023px) {
    header {
        margin: -30px -8% 0;
        padding-left: 8%;
        padding-right: 8%;
    }
}

@media (max-width: 767px) {
    header {
        margin: -20px -5% 0;
        padding-left: 5%;
        padding-right: 5%;
        padding-top: 80px;
    }
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

/* Sections */
section {
    margin-top: 60px;
    padding: 40px 0;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20px;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

section:hover::before {
    opacity: 0.5;
}

/* Footer */
footer {
    margin-top: 80px;
    text-align: center;
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bg-tertiary);
}

footer p {
    margin: 0;
    font-size: 18px;
    color: var(--text-muted);
}

/* Canvas */
canvas {
    display: block;
    border-radius: var(--border-radius-md);
}

/* Section paragraphs */
section p {
    text-align: justify;
    hyphens: auto;
}

section span {
    text-align: justify;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Image loading animation */
img {
    opacity: 1;
    transition: opacity var(--transition-normal);
}

img[data-loading="true"] {
    opacity: 0.5;
}
