/* Linigu - Professional Translation Tools & CAT Education Platform */

/* ============================================================================
   Variables & Color Scheme
   ============================================================================ */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --font-family-base: 'Inter', sans-serif;
    --font-family-heading: 'Playfair Display', serif;
    
    --transition-speed: 0.3s;
}

/* ============================================================================
   Global Styles
   ============================================================================ */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #222;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

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

/* ============================================================================
   Navigation
   ============================================================================ */

.navbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #ffffff !important;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #e0e0e0;
    backdrop-filter: none !important;
}

.navbar.navbar-scroll {
    background-color: #ffffff !important;
}

.navbar.scrolled {
    background-color: #ffffff !important;
}

.navbar-light {
    background-color: #ffffff !important;
}

.navbar-brand {
    font-size: 2rem;
    font-family: var(--font-family-heading);
    font-weight: 700;
    transition: color var(--transition-speed);
    color: #003366 !important;
    margin-right: 2rem;
    letter-spacing: 0.05em;
}

.navbar-brand i {
    display: none;
}

.navbar-brand:hover {
    color: #0052a3 !important;
}

.navbar-light .nav-link {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    transition: color var(--transition-speed);
    color: #333 !important;
}

.navbar-light .nav-link:hover,
.navbar-light .nav-link.active {
    color: #0052a3 !important;
}

.navbar-light .nav-link.btn-signup {
    color: #ffffff !important;
}

.navbar-light .nav-link.btn-signup:hover {
    color: #ffffff !important;
}

.btn-signup {
    background-color: #003366 !important;
    color: #ffffff !important;
    border: 2px solid #003366 !important;
    padding: 0.5rem 1.2rem !important;
    font-weight: 600 !important;
    border-radius: 0.375rem !important;
    transition: all var(--transition-speed) !important;
    display: inline-block;
    text-decoration: none !important;
}

.btn-signup:hover,
.btn-signup:focus {
    background-color: #0052a3 !important;
    border-color: #0052a3 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
    text-decoration: none !important;
}

.dropdown-menu {
    display: none !important;
    background-color: #ffffff !important;
    border: 2px solid #003366 !important;
    border-radius: 0.5rem;
    min-width: 220px;
}

.dropdown-menu.show {
    display: block !important;
    background-color: #ffffff !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    color: #003366 !important;
    padding: 0.75rem 1.25rem !important;
    transition: all var(--transition-speed);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: #e7f1ff !important;
    color: #0052a3 !important;
    padding-left: 1.5rem !important;
}

.dropdown-item:focus {
    background-color: #e7f1ff !important;
    color: #0052a3 !important;
}

.dropdown-item i {
    color: #003366 !important;
    margin-right: 0.5rem !important;
}

.dropdown-item:hover i {
    color: #0052a3 !important;
}

.dropdown-divider {
    border-top: 1px solid #003366 !important;
}

/* Language Selector Styling */
.language-selector {
    font-weight: 600 !important;
    color: #003366 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.35rem;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-selector:hover {
    background-color: #e7f1ff;
    color: #0052a3 !important;
}

.language-dropdown {
    min-width: 200px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    border-radius: 0.5rem !important;
    border: 2px solid #0052a3 !important;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.15) !important;
}

.language-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: #0052a3;
    border-radius: 10px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
    background: #003366;
}

.language-item {
    padding: 0.7rem 1rem !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.language-item:hover {
    background-color: #e7f1ff !important;
    color: #0052a3 !important;
    border-left-color: #0052a3;
    padding-left: 1.1rem !important;
}

.language-item.active {
    background-color: #e7f1ff !important;
    color: #0052a3 !important;
    border-left-color: #003366;
    font-weight: 600;
}

.country-flag {
    font-size: 1.2rem;
    display: inline-block;
    width: 20px;
    height: 14px;
    margin-right: 0.5rem;
    background-size: contain;
    background-repeat: no-repeat;
}

    margin: 0.25rem 0 !important;
}

.language-dropdown .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.country-flag {
    display: inline-block;
    margin-right: 0.5rem;
    width: 20px;
    height: 15px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    border-radius: 2px;
}

/* Country flags using flag emoji or CSS backgrounds */
.country-flag[data-country="en"]::before { content: "🇬🇧"; margin-right: 0.5rem; }
.country-flag[data-country="de"]::before { content: "🇩🇪"; margin-right: 0.5rem; }
.country-flag[data-country="fr"]::before { content: "🇫🇷"; margin-right: 0.5rem; }
.country-flag[data-country="es"]::before { content: "🇪🇸"; margin-right: 0.5rem; }
.country-flag[data-country="it"]::before { content: "🇮🇹"; margin-right: 0.5rem; }
.country-flag[data-country="ja"]::before { content: "🇯🇵"; margin-right: 0.5rem; }
.country-flag[data-country="ar"]::before { content: "🇸🇦"; margin-right: 0.5rem; }
.country-flag[data-country="pt"]::before { content: "🇵🇹"; margin-right: 0.5rem; }
.country-flag[data-country="ru"]::before { content: "🇷🇺"; margin-right: 0.5rem; }
.country-flag[data-country="ko"]::before { content: "🇰🇷"; margin-right: 0.5rem; }
.country-flag[data-country="tr"]::before { content: "🇹🇷"; margin-right: 0.5rem; }
.country-flag[data-country="vi"]::before { content: "🇻🇳"; margin-right: 0.5rem; }
.country-flag[data-country="uk"]::before { content: "🇺🇦"; margin-right: 0.5rem; }
.country-flag[data-country="zh"]::before { content: "🇨🇳"; margin-right: 0.5rem; }

.flag-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed);
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================================================
   Forms
   ============================================================================ */

.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-text {
    color: #999;
    font-size: 0.875rem;
}

/* ============================================================================
   Alerts
   ============================================================================ */

.alert {
    border-radius: 4px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ============================================================================
   Blog Styles
   ============================================================================ */

.article-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    background-color: #f0f0f0;
}

.article-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-card-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.article-card-author {
    display: flex;
    align-items: center;
}

.article-card-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 0.75rem;
}

.article-detail {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-detail h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-detail h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-detail img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.article-detail code {
    background-color: #f4f4f4;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.article-detail pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.article-detail table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-detail table th {
    background-color: #f4f4f4;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

.article-detail table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
}

.article-category-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.article-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: #f0f0f0;
    color: #333;
    transition: all var(--transition-speed);
}

.article-tag:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* ============================================================================
   Hero Section
   ============================================================================ */

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

/* ============================================================================
   Breadcrumbs
   ============================================================================ */

.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item.active {
    color: #666;
}

.breadcrumb-item a {
    color: var(--primary-color);
}

/* ============================================================================
   Pagination
   ============================================================================ */

.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
    border-color: #ddd;
}

.page-link:hover {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #ddd;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.sidebar-widget {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.sidebar-widget h5 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
}

.sidebar-widget ul li {
    margin-bottom: 0.75rem;
}

.sidebar-widget ul li a {
    display: block;
    padding: 0.5rem 0;
    color: #333;
    transition: all var(--transition-speed);
}

.sidebar-widget ul li a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

.sidebar-widget ul li.active a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================================================
   Footer
   ============================================================================ */

footer {
    background-color: #003366 !important;
    border-top: 3px solid #0052a3;
}

footer .bg-dark {
    background-color: #003366 !important;
}

footer h5,
footer h6 {
    color: #ffffff !important;
}

footer .text-light {
    color: #ffffff !important;
}

footer .text-muted {
    color: #b0c4de !important;
}

footer a {
    color: #ffffff !important;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: #87ceeb !important;
}

footer .bg-secondary {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

footer {
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
}

footer a {
    color: #ccc;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: white;
    text-decoration: none;
}

footer h5, footer h6 {
    color: white;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Tablets */
@media (max-width: 992px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .hero {
        padding: 3rem 0;
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .navbar {
        padding: 0.5rem 0;
        background-color: #ffffff !important;
    }
    
    .navbar-light {
        background-color: #ffffff !important;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .container-xl {
        padding: 0 1rem;
    }
    
    .article-card-image {
        height: 150px;
    }
    
    .article-card-title {
        font-size: 1.1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }

    .navbar {
        background-color: #ffffff !important;
    }
    
    .navbar-light {
        background-color: #ffffff !important;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }
    
    .article-card-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-card-meta span:not(:last-child) {
        margin-bottom: 0.5rem;
    }
    
    footer .row {
        text-align: center;
    }
    
    footer .col-md-6 {
        text-align: center !important;
    }
}

/* RTL Support */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .navbar-brand {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .nav-item {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

html[dir="rtl"] .container-xl {
    direction: rtl;
}

/* ============================================================================
   Accessibility
   ============================================================================ */

/* Focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-link:focus {
    left: auto;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    nav, footer {
        display: none;
    }
    
    a {
        color: inherit;
    }
}
