/* ============================================
   MAIN GLOBAL STYLES
   General Utilities and Global Rules
   ============================================ */

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

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f4f7fa 0%, #e8ecf1 100%);
    color: #374151;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

p {
    margin-bottom: 12px;
}

headings (h1, h2, h3, h4, h5, h6) {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #1f2937;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-lg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selection Styling */
::selection {
    background: #2563eb;
    color: white;
}

::-moz-selection {
    background: #2563eb;
    color: white;
}

/* Code Block Styling */
code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* List Styling */
ul,
ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 8px;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: 2px solid #e5e7eb;
}

/* Card Styles */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 16px;
}

.card-body {
    padding: 0;
}

/* Grid System */
.grid {
    display: grid;
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Flexbox Utilities */
.flex-row {
    display: flex;
    gap: 16px;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Responsive Grid */
@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    h4 {
        font-size: 1rem;
    }

    h5 {
        font-size: 0.95rem;
    }

    h6 {
        font-size: 0.9rem;
    }

    .container,
    .container-lg,
    .container-sm {
        padding: 0 12px;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 8px;
    }

    .card {
        padding: 16px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .no-print,
    nav,
    .sidebar,
    .top-bar,
    .footer {
        display: none;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
    }

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

    th,
    td {
        border-color: #999;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-in {
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}