/* SEO and Performance Enhancements */

/* Improve Core Web Vitals */

/* Largest Contentful Paint (LCP) Optimization */
.hero,
.page-hero {
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* First Input Delay (FID) Optimization */
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

/* Cumulative Layout Shift (CLS) Prevention */
img,
video,
iframe {
    aspect-ratio: attr(width) / attr(height);
}

.image-placeholder {
    aspect-ratio: 16 / 9;
}

/* Font Loading Optimization */
@font-face {
    font-family: 'Inter';
    font-display: swap;
    font-weight: 400 900;
}

/* Critical CSS Inline (for above-the-fold content) */
.hero,
.header {
    will-change: transform;
}

/* Reduce JavaScript Execution Time */
.animate-on-scroll {
    content-visibility: auto;
}

/* Optimize Images */
img {
    loading: lazy;
    decoding: async;
}

/* Preload Critical Resources */
.hero-title,
.hero-subtitle {
    font-display: swap;
}

/* Improve Text Rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better Link Prefetching */
a[href^="/"] {
    rel: prefetch;
}

/* Schema Markup Visual Indicators (hidden) */
[itemscope] {
    display: contents;
}

/* Improve Semantic HTML */
main {
    display: block;
}

article,
section,
aside,
nav {
    display: block;
}

/* Better Heading Hierarchy */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

/* Improve Readability */
p {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

/* Better Focus Indicators for SEO */
:focus-visible {
    outline: 3px solid var(--premium-primary);
    outline-offset: 2px;
}

/* Improve Link Accessibility */
a:not(.btn) {
    /*text-decoration: underline;*/
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:not(.btn):hover {
    text-decoration-thickness: 2px;
}

/* Better Form Labels for SEO */
label {
    font-weight: 600;
}

/* Improve Button Semantics */
button,
.btn {
    cursor: pointer;
    user-select: none;
}

/* Better List Styling */
ul:not(.nav-menu):not(.footer-section ul),
ol {
    padding-left: 1.5rem;
}

/* Improve Table Accessibility */
table {
    caption-side: top;
}

caption {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Better Blockquote Styling */
blockquote {
    border-left: 4px solid var(--premium-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Improve Code Block Styling */
code {
    font-family: 'Courier New', monospace;
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

/* Better Horizontal Rules */
hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

/* Improve Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--premium-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Better ARIA Support */
[aria-hidden="true"] {
    display: none;
}

[aria-label] {
    cursor: help;
}

/* Improve Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(0, 102, 255, 0.3);
    border-top-color: var(--premium-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Better Error States */
.error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Success States */
.success {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
}

/* Improve Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.breadcrumb li {
    margin: 0;
    padding: 0 0.5rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--premium-primary);
    text-decoration: underline;
}

/* Better Pagination (if any) */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--premium-primary);
    color: white;
    border-color: var(--premium-primary);
}

.pagination .active {
    background: var(--premium-primary);
    color: white;
    border-color: var(--premium-primary);
}

/* Improve Search Functionality (if any) */
.search-form {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
}

/* Better Modal/Dialog Styling */
[role="dialog"] {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

[role="dialog"]::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* Improve Notification/Toast Messages */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s;
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

.notification.info {
    border-left: 4px solid var(--premium-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Better Tooltip Styling */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-dark);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-dark);
    z-index: 1000;
    pointer-events: none;
}

/* Improve Badge/Tag Styling */
.badge,
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.badge.primary {
    background: var(--premium-primary);
    color: white;
    border-color: var(--premium-primary);
}

.badge.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.badge.warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.badge.error {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Better Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.empty-state p {
    max-width: 500px;
    margin: 0 auto;
}

/* Improve Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Better Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Improve Accordion/FAQ Styling */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    padding: 1.5rem;
}

.accordion-icon {
    transition: transform 0.3s;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

/* Better Tab Navigation */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
    white-space: nowrap;
}

.tab:hover {
    color: var(--premium-primary);
    background: rgba(0, 102, 255, 0.05);
}

.tab.active {
    color: var(--premium-primary);
    border-bottom-color: var(--premium-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Improve Dropdown Menus */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
    margin-top: 0.5rem;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--premium-primary);
}

/* Better Alert/Notice Styling */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert.info {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--premium-primary);
    color: var(--text-dark);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: var(--text-dark);
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: var(--text-dark);
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: var(--text-dark);
}

/* Improve Card Styling */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.card-body {
    margin-bottom: 1.5rem;
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Better Divider Styling */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
    border: none;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-color);
    margin: 0 2rem;
    border: none;
}

/* Improve Spacing Utilities */
.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; }
.mt-5 { margin-top: 3rem; }

.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; }
.mb-5 { margin-bottom: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--premium-primary); }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-error { color: #ef4444; }
.text-light { color: var(--text-light); }
.text-dark { color: var(--text-dark); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

@media (max-width: 768px) {
    .hidden-mobile { display: none; }
}

@media (min-width: 769px) {
    .hidden-desktop { display: none; }
}

