/* Tool Tài Xỉu - Main CSS (Global Styles) */

/* Accessibility Helpers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Variables */
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --accent-color: #10b981;
    --accent-dark: #059669;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Spacing */
    --container-max: 1200px;
    --section-padding: 80px 0;
    --card-padding: 2rem;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Base Typography */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
h6 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background: var(--secondary-color);
    color: white;
}

::-moz-selection {
    background: var(--secondary-color);
    color: white;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--secondary-color);
}

/* Container & Layout */
.container,
.header-container,
.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Navigation */
.header-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-navbar .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.header-navbar-brand:hover {
    color: white !important;
}

.header-navbar-collapse {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.header-nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.header-nav-link:hover,
.header-nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-navbar-toggler {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.header-navbar-toggler::before {
    content: '☰';
    font-size: 1.5rem;
}

.header-navbar-toggler.active::before {
    content: '✕';
}


/* Search Form */
.header-search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
}

.header-search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    outline: none;
    width: 200px;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-search-btn {
    background: var(--secondary-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-btn:hover {
    background: var(--secondary-dark);
}

.header-search-btn svg {
    width: 16px;
    height: 16px;
}

/* Page Header */
.site-page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8rem 0 4rem;
    margin-top: 70px;
    text-align: center;
}

.site-header-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.site-header-description {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.site-breadcrumb {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.site-breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.site-breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    opacity: 0.6;
}

.site-breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition-fast);
}

.site-breadcrumb-item a:hover {
    color: white;
}

.site-breadcrumb-item.active {
    color: white;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition-normal);
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary.large,
.btn-secondary.large {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-dark);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-icon {
    font-size: 1.2em;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-light);
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 4rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.site-footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.site-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.site-footer-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 0;
    font-size: 1rem;
}

.site-footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.site-footer-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.site-footer-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.5rem;
}

.site-footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--secondary-color);
    border-radius: 1px;
}

.site-footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.site-footer-menu li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    padding: 0.25rem 0;
    display: inline-block;
    position: relative;
}

.site-footer-menu li a:hover {
    color: white;
    transform: translateX(5px);
}

.site-footer-menu li a::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--secondary-color);
    transition: width var(--transition-fast);
}

.site-footer-menu li a:hover::before {
    width: 10px;
}

.site-contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.site-contact-icon {
    font-size: 1.1em;
    width: 20px;
    display: flex;
    justify-content: center;
    opacity: 0.9;
}

.site-social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.site-social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.site-social-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

.site-social-icon {
    font-size: 1.2em;
    filter: grayscale(0.2);
}

.site-footer-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 2rem 0 1.5rem;
}

.site-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 0.5rem;
}

.site-footer-copyright {
    flex: 1;
}

.site-copyright-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.site-footer-legal {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.site-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.site-legal-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    padding: 0.25rem 0;
}

.site-legal-link:hover {
    color: white;
    transform: translateY(-1px);
}

.site-legal-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--secondary-color);
    transition: width var(--transition-fast);
}

.site-legal-link:hover::after {
    width: 100%;
}

/* Back to Top */
.site-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.site-btn-floating {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.site-btn-floating:hover {
    background: var(--primary-dark);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Modal styles - Simplified (if needed) */

/* Notification/Toast styles */
.notification {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: 1rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge.primary {
    background: var(--primary-color);
    color: white;
}

.badge.success {
    background: var(--success-color);
    color: white;
}

.badge.warning {
    background: var(--warning-color);
    color: white;
}

.badge.danger {
    background: var(--danger-color);
    color: white;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Skeleton loading - Removed for simplicity */

/* Lazy loading images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Blog card general styles */
.blog-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-light);
}

.blog-card:hover {
    box-shadow: var(--shadow-xl);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.blog-card:hover .blog-image img {
    scale: 1.05;
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.blog-date,
.blog-category {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-read-more {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
}

.blog-read-more:hover {
    color: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .site-footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .header-navbar-collapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }
    
    .header-navbar-collapse.show {
        display: flex;
    }
    
    .header-navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .header-search-form {
        width: 100%;
        margin-top: 1rem;
    }
    
    .header-search-input {
        width: 100%;
    }
    
    .header-navbar-toggler {
        display: block;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container,
    .header-container,
    .footer-container {
        padding: 0 1rem;
    }
    
    .site-footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 2rem;
    }
    
    .site-footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .site-footer-brand {
        text-align: center;
        gap: 1rem;
    }
    
    .site-social-links {
        justify-content: center;
    }
    
    .site-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .site-footer-legal {
        justify-content: center;
    }
    
    .site-legal-links {
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .btn-primary.large,
    .btn-secondary.large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .site-footer {
        padding: 3rem 0 1rem;
    }
    
    .site-footer-content {
        gap: 2rem;
    }
    
    .site-footer-links {
        gap: 1.5rem;
    }
    
    .site-footer-logo {
        font-size: 1.5rem;
    }
    
    .site-social-links {
        gap: 0.75rem;
    }
    
    .site-social-link {
        width: 40px;
        height: 40px;
    }
    
    .site-legal-links {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .site-copyright-text {
        font-size: 0.85rem;
    }
    
    .site-legal-link {
        font-size: 0.8rem;
    }
}

/* Alert styles */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert-info {
    background-color: #e7f3ff;
    border-color: #b8daff;
    color: #004085;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-md-end { text-align: right; }

.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; }

.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; }

.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

.text-decoration-none { text-decoration: none; }
.text-muted { color: var(--text-secondary); }

.fw-bold { font-weight: 700; }

.me-2 { margin-right: 1rem; }
.me-3 { margin-right: 1.5rem; }

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.list-unstyled {
    list-style: none;
    padding-left: 0;
}

@media (max-width: 767.98px) {
    .text-md-end {
        text-align: left;
    }
    
    .post-sidebar {
        padding-left: 0;
        margin-top: 2rem;
    }
}

/* Print styles */
@media print {
    .header-navbar,
    .site-footer,
    .site-back-to-top {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .container,
    .header-container,
    .footer-container {
        max-width: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --bg-primary: #ffffff;
        --border-color: #000000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
