/* Modern Classless CSS Framework v2.0 */

:root {
    /* Modern Color Palette */
    --primary: #364153;
    --primary-light: #202732;
    --primary-dark: #364153;
    --secondary: #64748b;
    --secondary-light: #94a3b8;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --info: #0ea5e9;
    --info-light: #38bdf8;
    --light: #f8fafc;
    --dark: #1e293b;
    --body-bg: #ffffff;
    --body-color: #334155;
    --heading-color: #1e293b;
    --link-color: #3b82f6;
    --link-hover-color: #0b65ff;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-link: linear-gradient(135deg, var(--link-color) 0%, var(--link-hover-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    --gradient-success: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    --gradient-danger: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    --gradient-info: linear-gradient(135deg, var(--info) 0%, var(--info-light) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --font-family-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-base: 1rem;
    --spacing-base-half: 0.5rem;
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-md: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --border-radius-full: 9999px;
    --container-max-width: 1200px;

    /* Animation */
    --transition-base: all 0.2s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* Dark mode */
:root {
    color-scheme: dark;
    --color-mode: 'dark';
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-mode: 'dark';
    }
}

:root {
    --primary: #13181f;
    --primary-light: #13181f;
    --primary-dark: #cbe0ff;

    --body-bg: #0f172a;
    --body-color: #e2e8f0;
    --heading-color: #f8fafc;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-bg: #1e293b;

    /* Dark mode shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

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

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--body-color);
    background-color: var(--body-bg);
    padding: var(--spacing-base);
    max-width: var(--container-max-width);
    margin: 0 auto;
    transition: var(--transition-slow);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin-bottom: var(--spacing-base);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2.75rem;
    margin-top: 2rem;
    background: var(--heading-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

h2 {
    font-size: 2.25rem;
    margin-top: 1.75rem;
    position: relative;
}

h2::after {
    content: "";
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 0.15rem;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-full);
}

h3 {
    font-size: 1.75rem;
    margin-top: var(--spacing-base);
}

h4 {
    font-size: 1.5rem;
    margin-top: 1.25rem;
}

h5 {
    font-size: 1.25rem;
    margin-top: 1rem;
}

h6 {
    font-size: 1rem;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

p {
    margin-top: var(--spacing-base-half);
    margin-bottom: var(--spacing-base);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition-base);
    position: relative;
}

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

a:not(nav a):before {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--gradient-link);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

a:not(nav a):hover:before {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* New styles for external links */
a[target="_blank"]:after {
    content: "[+]"; /* Unicode character for north east arrow */
    display: inline-block;
    margin-left: 0.25em;
    font-size: 0.6em;
    font-weight: bold;
    text-decoration: none;
    vertical-align: super;
}


small {
    font-size: 0.875rem;
    opacity: 0.85;
}

code, pre {
    font-family: var(--font-family-mono);
    border-radius: var(--border-radius);
}

code {
    padding: 0.2em 0.4em;
    font-size: 0.875em;
    background-color: rgba(0, 0, 0, 0.05);
}

:root code {
    background-color: rgba(255, 255, 255, 0.1);
}

pre {
    padding: var(--spacing-base);
    margin-bottom: var(--spacing-base);
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

:root pre {
    background-color: rgba(255, 255, 255, 0.05);
}

pre code {
    display: block;
    background-color: transparent;
}

blockquote {
    border-left: 4px solid var(--primary);
    padding: var(--spacing-base);
    margin-bottom: var(--spacing-base);
    font-style: italic;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--shadow-sm);
}

:root blockquote {
    background-color: rgba(255, 255, 255, 0.03);
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    /*margin: calc(var(--spacing-base) * 2) 0;*/
    margin: 10px;
}

/* Lists */
ul, ol {
    margin-bottom: var(--spacing-base);
    padding-left: 1.5rem;
}

li {
    margin-bottom: calc(var(--spacing-base) * 0.5);
}


/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--spacing-base);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: calc(var(--spacing-base) * 0.75);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

thead {
    background: var(--gradient-secondary);
}

th {
    font-weight: var(--font-weight-bold);
    color: white;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

:root tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Forms */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input[type="text"],
input[type="file"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
select,
textarea {
    display: block;
    width: 100%;
    padding: calc(var(--spacing-base) * 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--body-bg);
    color: var(--body-color);
    margin-bottom: var(--spacing-base);
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23364153' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 2rem;
}

:root select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23e2e8f0' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

textarea {
    min-height: 9rem;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: calc(var(--spacing-base) * 0.5);
    font-weight: var(--font-weight-medium);
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    min-width: 100px;
    display: inline-block;
    padding: calc(var(--spacing-base) * 0.75) var(--spacing-base);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: var(--font-weight-medium);
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

button::after,
input[type="button"]::after,
input[type="reset"]::after,
input[type="submit"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    transition: var(--transition-base);
}

button:hover::after,
input[type="button"]:hover::after,
input[type="reset"]:hover::after,
input[type="submit"]:hover::after {
    background-color: rgba(255, 255, 255, 0.1);
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    box-shadow: var(--shadow-md);
}

button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm);
}

button:disabled,
input[type="button"]:disabled,
input[type="reset"]:disabled,
input[type="submit"]:disabled {
    background: var(--gradient-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

/* Button Variants */
button.success,
input[type="button"].success,
input[type="submit"].success {
    background: var(--gradient-success);
}

button.danger,
input[type="button"].danger,
input[type="submit"].danger {
    background: var(--gradient-danger);
}

button.warning,
input[type="button"].warning,
input[type="submit"].warning {
    background: var(--gradient-warning);
}

button.info,
input[type="button"].info,
input[type="submit"].info {
    background: var(--gradient-info);
}

button.outline,
input[type="button"].outline,
input[type="submit"].outline {
    background: transparent;
    border: 1px solid var(--primary-dark);
    color: var(--primary-dark);
}

button.outline:hover,
input[type="button"].outline:hover,
input[type="submit"].outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    transition: var(--transition-base);
    box-shadow: var(--shadow);
}

img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

figure {
    text-align: center;
    margin-bottom: var(--spacing-base);
}

figcaption {
    font-size: 0.875rem;
    color: var(--secondary);
    text-align: center;
    margin-top: calc(var(--spacing-base) * 0.5);
    font-style: italic;
}

details summary {
    cursor: pointer;
    position: relative;
    padding-bottom: calc(var(--spacing-base) * 0.5);
}

details summary::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
}

details > *:not(summary) {
    cursor: auto;
    margin-top: calc(var(--spacing-base) * 0.5);
}

/* Cards */
article, section, aside {
    margin-bottom: calc(var(--spacing-base) * 2);
    padding: var(--spacing-base);
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
}

article:hover, section:hover, aside:hover {
    box-shadow: var(--shadow-md);
}

/* Utility for focus outline */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb {
    /*background: var(--gradient-secondary);*/
    background: rgb(15, 23, 42);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    /*background: var(--gradient-primary);*/
    background: rgb(15, 23, 42);
}

/* Glass effect for special elements */
/* Glass effect for special elements */
.glass {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--body-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

:root .glass {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add a specific text shadow for better readability in light mode */
:root:not([color-scheme="dark"]) .glass {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body {
        padding: calc(var(--spacing-base) * 0.75);
    }

    table {
        width: 100%;
        display: block;
        overflow-x: auto;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* Print styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    pre, blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        background: var(--gradient-secondary);
        display: table-header-group;
    }

    tr, img {
        page-break-inside: avoid;
    }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    /* Disable gradients and effects for print */
    h1, h2::after, button, input[type="button"], input[type="reset"], input[type="submit"] {
        background: none !important;
        -webkit-text-fill-color: #000;
        text-fill-color: #000;
        box-shadow: none !important;
    }

    article, section, aside, img, pre, blockquote, table {
        box-shadow: none !important;
    }
}

/* Add transitions for color scheme changes */
body,
a,
button,
input,
select,
textarea,
th,
td,
code,
pre,
blockquote,
article,
section,
aside {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Color scheme toggle animation */
@keyframes colorSchemeTransition {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

body {
    animation: colorSchemeTransition 0.5s ease-out;
}
