/**
 * TylerRossUSA Mobile-First Framework
 * Comprehensive responsive design for all domains
 * Author: GitHub Copilot | Date: 2025-12-12
 */

/* ===================================================================
   RESET & BASE STYLES
   =================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* ===================================================================
   TYPOGRAPHY (Mobile First)
   =================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin: 1.5rem 0 0.5rem 0;
}

h1 {
    font-size: 1.75rem;
    color: #1a1a1a;
}

h2 {
    font-size: 1.5rem;
    color: #2d2d2d;
}

h3 {
    font-size: 1.25rem;
    color: #404040;
}

h4 {
    font-size: 1.1rem;
}

h5, h6 {
    font-size: 1rem;
}

p {
    margin: 1rem 0;
    color: #555;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus {
    color: #0052a3;
    text-decoration: underline;
    outline: none;
}

/* Focus visible for accessibility */
a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ===================================================================
   CONTAINER & LAYOUT (Mobile First)
   =================================================================== */

.container {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

.container-fluid {
    width: 100%;
    padding: 0;
}

main, section, article {
    display: block;
    width: 100%;
}

/* ===================================================================
   HEADER & NAVIGATION (Mobile First)
   =================================================================== */

header {
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.nav-brand a {
    color: inherit;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #333;
}

.nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    list-style: none;
}

.nav-menu.active {
    display: flex;
}

.nav-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.nav-item a {
    display: block;
    color: #333;
    padding: 0.5rem 0;
}

.nav-item a:hover {
    color: #0066cc;
}

/* ===================================================================
   BUTTONS (Mobile First)
   =================================================================== */

button, .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    font-weight: 500;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #0052a3;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #e6e6e6;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===================================================================
   FORMS (Mobile First)
   =================================================================== */

form {
    width: 100%;
}

label {
    display: block;
    margin: 0.75rem 0 0.25rem 0;
    font-weight: 500;
    color: #333;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0 1rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input[type="checkbox"], input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* ===================================================================
   GRID SYSTEM (Mobile First)
   =================================================================== */

.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    width: 100%;
}

.col-auto {
    width: auto;
}

/* ===================================================================
   CARDS & COMPONENTS (Mobile First)
   =================================================================== */

.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.card-body {
    padding: 0;
}

.card-footer {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

/* ===================================================================
   TABLES (Mobile First - Stack on mobile)
   =================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

thead {
    background-color: #f5f5f5;
}

th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background-color: #f9f9f9;
}

/* Stack table on mobile */
@media (max-width: 640px) {
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1.5rem;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

    td {
        position: relative;
        padding-left: 40%;
        text-align: right;
        border: none;
        border-bottom: 1px solid #e0e0e0;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        font-weight: 600;
        text-align: left;
    }
}

/* ===================================================================
   IMAGES & MEDIA (Mobile First)
   =================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-responsive {
    width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

figure {
    margin: 1rem 0;
}

figcaption {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

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

/* Responsive aspect ratio boxes */
.aspect-ratio {
    position: relative;
    overflow: hidden;
}

.aspect-ratio-16x9 {
    padding-bottom: 56.25%;
}

.aspect-ratio-4x3 {
    padding-bottom: 75%;
}

.aspect-ratio-1x1 {
    padding-bottom: 100%;
}

.aspect-ratio > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================================================================
   SPACING UTILITIES (Mobile First)
   =================================================================== */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* ===================================================================
   FOOTER (Mobile First)
   =================================================================== */

footer {
    background-color: #f5f5f5;
    color: #666;
    padding: 2rem 1rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

footer a {
    color: #0066cc;
}

footer a:hover {
    color: #0052a3;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.footer-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 0.5rem 0;
}

/* ===================================================================
   UTILITIES & HELPERS (Mobile First)
   =================================================================== */

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

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: #999;
    font-size: 0.9rem;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-info {
    color: #17a2b8;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ===================================================================
   RESPONSIVE BREAKPOINTS
   =================================================================== */

/* Tablets (640px and up) */
@media (min-width: 640px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .nav-toggle {
        display: none;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        width: auto;
        margin-top: 0;
    }

    .nav-item {
        padding: 0;
        margin: 0 1rem;
        border: none;
    }

    .nav-item a {
        padding: 0;
    }

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

    .col-2 {
        grid-column: span 1;
    }

    .col-4 {
        grid-column: span 2;
    }

    .col-6 {
        grid-column: span 1;
    }

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

/* Desktops (1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0;
    }

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

    .col-1 { grid-column: span 1; }
    .col-2 { grid-column: span 2; }
    .col-3 { grid-column: span 3; }
    .col-4 { grid-column: span 4; }
    .col-5 { grid-column: span 5; }
    .col-6 { grid-column: span 6; }
    .col-7 { grid-column: span 7; }
    .col-8 { grid-column: span 8; }
    .col-9 { grid-column: span 9; }
    .col-10 { grid-column: span 10; }
    .col-11 { grid-column: span 11; }
    .col-12 { grid-column: span 12; }

    button, .btn {
        min-height: auto;
    }

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

/* Large Desktops (1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    body {
        background-color: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    header, footer, .no-print {
        display: none;
    }

    img {
        max-width: 100%;
    }
}

/* ===================================================================
   DARK MODE SUPPORT (Optional)
   =================================================================== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #f5f5f5;
    }

    a {
        color: #66b3ff;
    }

    a:hover, a:focus {
        color: #99ccff;
    }

    header {
        background-color: #262626;
        border-bottom-color: #404040;
    }

    .card {
        background-color: #262626;
        border-color: #404040;
    }

    input, textarea, select {
        background-color: #333;
        color: #e0e0e0;
        border-color: #404040;
    }

    input:focus, textarea:focus, select:focus {
        border-color: #66b3ff;
        box-shadow: 0 0 0 3px rgba(102, 179, 255, 0.1);
    }

    footer {
        background-color: #262626;
        color: #999;
        border-top-color: #404040;
    }
}

/* ===================================================================
   ACCESSIBILITY ENHANCEMENTS
   =================================================================== */

/* High contrast mode */
@media (prefers-contrast: more) {
    body {
        border: 1px solid currentColor;
    }

    button, .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
