/* ========================================
   GUACAMOLE™ BASE STYLES
   Reset, Typography, and Core Elements
   ======================================== */

/* Import Variables */
@import url('./variables.css');

/* ========================================
   CSS RESET & NORMALIZATION
   ======================================== */

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

/* The root size everything in rem scales from. A percentage, so a visitor's
   own browser font-size setting still counts: 100% is 16px by default. */
html {
    margin: 0;
    padding: 0;
    font-size: 100%;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background: transparent;
}

/* Laptops get the whole site a step smaller: layouts sized for a 1920px
   monitor look oversized on a 1280–1536px laptop screen. Desktops (1600px
   and up) keep 100%; phones and tablets (1024px and down) keep it too, for
   legibility and so inputs stay at 16px, below which iOS zooms in on focus. */
@media (min-width: 1025px) and (max-width: 1599px) {
    html {
        font-size: 93.75%;  /* 15px */
    }
}

/* A short laptop viewport (1366×768, 1536×864 once the browser's own bars
   are counted) a step further, so a hero still fits above the fold. */
@media (min-width: 1025px) and (max-height: 820px) {
    html {
        font-size: 87.5%;  /* 14px */
    }
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-color);
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ========================================
   SCROLLBARS
   ======================================== */

/* A slim rounded thumb that follows the theme, on every scrolling area.
   The transparent border insets the thumb inside its gutter; hovering thickens
   it and turns it brand blue. */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* The page's own scrollbar takes its style from <body>. A transparent track
   there shows whatever is behind the document — inside the docs editor that is
   the iframe's white backdrop — so paint it in the body's colour. */
body::-webkit-scrollbar-track,
body::-webkit-scrollbar-corner {
    background-color: inherit;
}

::-webkit-scrollbar-thumb {
    min-height: 40px;
    min-width: 40px;
    background-color: var(--scrollbar-thumb);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
    border-width: 2px;
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-active);
    border-width: 2px;
}

/* Firefox has only the standard properties. They stay out of Chromium and
   Safari: there, setting them switches the rules above off. */
@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    }

    * {
        scrollbar-width: thin;
    }
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

/* Text Elements */
p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

strong, b {
    font-weight: var(--font-weight-semibold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

code {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    background-color: var(--bg-secondary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

pre {
    font-family: var(--font-family-mono);
    background-color: var(--bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

pre code {
    background: none;
    padding: 0;
}

/* ========================================
   LISTS
   ======================================== */

ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

/* Reset list styles for navigation */
.nav ul,
.navbar ul,
.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav li,
.navbar li,
.menu li {
    margin: 0;
}

/* ========================================
   FORM ELEMENTS (Basic Reset)
   ======================================== */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    cursor: pointer;
    -webkit-appearance: button;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Remove default focus styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ========================================
   MEDIA ELEMENTS
   ======================================== */

img,
video,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
}

svg {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

/* ========================================
   TABLE ELEMENTS
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: var(--space-4);
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Links */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: 6px;
}

/* Focus Management */
.focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Hide elements */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 576px) {
    .container {
        padding: 0 var(--space-6);
    }
}

/* Content Container */
.content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Show/Hide on Mobile */
@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .visible-mobile {
        display: none !important;
    }
}

/* ========================================
   ANIMATION & TRANSITION UTILITIES
   ======================================== */

.transition-all {
    transition: all var(--transition-normal);
}

.transition-colors {
    transition: background-color var(--transition-normal), 
                border-color var(--transition-normal), 
                color var(--transition-normal);
}

.transition-transform {
    transition: transform var(--transition-normal);
}

/* Reduced Motion Support */
@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;
    }
}