/**
 * SEO Optimization CSS
 * Các style để tối ưu hóa SEO và trải nghiệm người dùng
 */

/* Schema.org structured data styling */
.schema-product,
.schema-article,
.schema-breadcrumb {
    display: none; /* Ẩn structured data khỏi hiển thị */
}

/* Breadcrumb styling for better UX */
.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
    margin: 0 8px;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* Heading hierarchy for better SEO */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

h4 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
    line-height: 1.4;
}

h5 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

h6 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}



/* Link optimization */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

a:focus:not(:focus-visible) {
    outline: none;
}

/* Bỏ gạch chân cho orange-logo-link và orange-logo-text */
.orange-logo-link,
.orange-logo-link:hover,
.orange-logo-text,
.orange-logo-text:hover,
.orange-logo-link:hover .orange-logo-text {
    text-decoration: none !important;
}

/* Content readability */
.content {
    line-height: 1.6;
    font-size: 16px;
}

.content p {
    margin-bottom: 1rem;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Table optimization */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Form optimization */
.form-control:focus:not(:focus-visible) {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button optimization */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error states */
.error {
    color: #dc3545;
    border-color: #dc3545;
}

/* Success states */
.success {
    color: #28a745;
    border-color: #28a745;
}

/* Responsive images */
.img-responsive {
    width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .breadcrumb {
        display: none;
    }
}

/* Accessibility improvements */
.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;
}

/* Focus indicators - chỉ hiển thị khi user dùng keyboard, không khi refresh */
*:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus-visible {
    top: 6px;
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.skip-link:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .form-control {
        border-width: 2px;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-color: #e9ecef;
        --bs-body-bg: #212529;
        --bs-border-color: #495057;
    }
}

/* Performance optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Critical CSS for above-the-fold content */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* SEO-friendly microdata styling */
[itemscope] {
    display: block;
}

[itemprop="name"] {
    font-weight: 600;
}

[itemprop="description"] {
    color: #6c757d;
    font-style: italic;
}

[itemprop="price"] {
    color: #28a745;
    font-weight: 600;
}

[itemprop="availability"] {
    display: none; /* Hidden from visual display */
}