/**
 * Professional Mobile-First Reset & Base Styles
 * Ensures consistent baseline across all browsers and devices
 */

/* ================================================================
   CSS RESET - MOBILE FIRST
   ================================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
}

/* Remove default button styling */
button {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* Remove default link styling */
a {
    color: inherit;
    text-decoration: none;
}

/* Remove default list styling */
ul,
ol {
    list-style: none;
}

/* Remove default form styling */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ================================================================
   RESPONSIVE BASE STYLES
   ================================================================ */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* Use dynamic viewport height */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apercu Mono Pro", monospace;
    font-size: clamp(14px, 2.5vw, 16px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, #000a0f 0%, #0a0505 100%);
    text-rendering: optimizeLegibility;
    word-wrap: break-word;
    overflow-x: hidden;
}

/* ================================================================
   RESPONSIVE TEXT ELEMENTS
   ================================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    word-break: break-word;
}

h1 { font-size: clamp(1.75rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(0.9rem, 1.5vw, 1.1rem); }

p {
    margin-bottom: 1.5em;
    line-height: 1.7;
}

/* ================================================================
   INTERACTIVE ELEMENTS - MOBILE OPTIMIZED
   ================================================================ */

button,
a[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

button:active,
a[role="button"]:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
    transform: scale(0.98);
}

button:disabled,
input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================================================
   FORM ELEMENTS - MOBILE FRIENDLY
   ================================================================ */

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px; /* Prevent zoom on iOS */
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00C9D7;
    outline: 3px solid #00C9D7;
    outline-offset: 0;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

/* ================================================================
   MEDIA ELEMENTS
   ================================================================ */

img,
video,
iframe {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-radius: 8px;
}

/* ================================================================
   TABLES - RESPONSIVE
   ================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

th {
    background: rgba(0, 201, 215, 0.1);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

tr:hover {
    background: rgba(0, 201, 215, 0.05);
}

/* ================================================================
   CODE & PREFORMATTED TEXT
   ================================================================ */

code,
pre {
    font-family: "Monaco", "Courier New", monospace;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

code {
    padding: 2px 6px;
    font-size: 0.9em;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

pre code {
    background: none;
    padding: 0;
}

/* ================================================================
   BLOCKQUOTES
   ================================================================ */

blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 4px solid #00C9D7;
    font-style: italic;
    opacity: 0.9;
}

/* ================================================================
   HORIZONTAL RULE
   ================================================================ */

hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ================================================================
   SCROLLBAR STYLING (Webkit browsers)
   ================================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 201, 215, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 201, 215, 0.8);
}

/* ================================================================
   SELECTION STYLES
   ================================================================ */

::selection {
    background: rgba(0, 201, 215, 0.3);
    color: rgba(255, 255, 255, 1);
}

::-moz-selection {
    background: rgba(0, 201, 215, 0.3);
    color: rgba(255, 255, 255, 1);
}

/* ================================================================
   PLACEHOLDER STYLING
   ================================================================ */

::placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid {
    display: grid;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================ */

/* Enable GPU acceleration for transforms */
.accelerate {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce motion if requested */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================================
   PRINT STYLES
   ================================================================ */

@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    p {
        widows: 3;
        orphans: 3;
    }

    img {
        max-width: 100%;
    }
}
