/**
 * SEO & Web Toolkit - Main Stylesheet
 * Developed by Rdx-Group
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Top Bar ===== */
.top-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 8px 0;
    font-size: 14px;
}

/* ===== Navigation ===== */
.navbar {
    padding: 15px 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900) !important;
}

.navbar-brand i {
    font-size: 1.75rem;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Mega Menu */
.mega-dropdown {
    position: static;
}

.mega-menu {
    width: 100%;
    padding: 20px 0;
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mega-menu-title {
    color: var(--gray-900);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 8px;
}

.mega-menu-list a {
    color: var(--gray-600);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mega-menu-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.mega-menu-list .view-all {
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

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

.hero-search {
    background: white;
    border-radius: var(--radius-xl);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    margin: 0 auto;
}

.hero-search input {
    border: none;
    padding: 15px 20px;
    font-size: 1.1rem;
    border-radius: var(--radius-xl);
}

.hero-search input:focus {
    outline: none;
    box-shadow: none;
}

.hero-search button {
    padding: 15px 30px;
    border-radius: var(--radius-xl) !important;
}

/* ===== Tool Categories ===== */
.category-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-title p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.category-card h4 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.category-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.category-card .tool-count {
    background: var(--gray-100);
    padding: 5px 15px;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--gray-700);
}

/* ===== Tool Card ===== */
.tool-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tool-card h5 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tool-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    flex-grow: 1;
}

.tool-card .btn {
    margin-top: 15px;
}

/* ===== Tool Page ===== */
.tool-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 40px 0;
    color: white;
}

.tool-header h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.tool-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.tool-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: -30px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.tool-form {
    margin-bottom: 30px;
}

.tool-form label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.tool-form .form-control {
    padding: 12px 15px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    transition: border-color 0.3s ease;
}

.tool-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tool-btn {
    padding: 12px 30px;
    font-weight: 500;
    border-radius: var(--radius);
}

/* ===== Results Section ===== */
.results-section {
    margin-top: 30px;
}

.result-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.result-card h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
}

.score-excellent {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, var(--info-color), #0891b2);
    color: white;
}

.score-average {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.score-poor {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

/* ===== Progress Bar Custom ===== */
.progress {
    height: 10px;
    border-radius: var(--radius-xl);
    background: var(--gray-200);
}

.progress-bar {
    border-radius: var(--radius-xl);
}

/* ===== Tables ===== */
.table-results {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-results th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    padding: 15px;
}

.table-results td {
    padding: 15px;
    vertical-align: middle;
}

/* ===== Feature List ===== */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    width: 20px;
    margin-right: 10px;
}

.feature-list .fa-check {
    color: var(--success-color);
}

.feature-list .fa-times {
    color: var(--danger-color);
}

.feature-list .fa-exclamation-triangle {
    color: var(--warning-color);
}

/* ===== Stats Section ===== */
.stats-section {
    background: var(--gray-800);
    padding: 60px 0;
    color: white;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--gray-400);
    font-size: 1rem;
}

/* ===== Footer ===== */
.footer {
    background: var(--gray-900);
}

.footer-title {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--gray-400);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 15px;
    color: var(--gray-400);
}

.footer-contact a {
    color: var(--gray-400);
}

.footer-contact a:hover {
    color: white;
}

/* ===== Back to Top ===== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

#backToTop.show {
    display: flex;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 15px 20px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

/* ===== Loading Spinner ===== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

/* ===== Page Styles ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 60px 0;
    color: white;
    text-align: center;
}

.page-header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-content {
    padding: 60px 0;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .mega-menu {
        padding: 15px;
    }
    
    .mega-menu .col-md-2 {
        margin-bottom: 20px;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .tool-container {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== Utility Classes ===== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

/* ===== Language Switcher ===== */
.language-switcher {
    display: inline-block;
}

.language-switcher .dropdown-toggle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
}

.language-switcher .dropdown-toggle:hover,
.language-switcher .dropdown-toggle:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.language-switcher .dropdown-menu {
    min-width: 180px;
    padding: 10px;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.language-switcher .dropdown-item {
    padding: 10px 15px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.language-switcher .dropdown-item:hover {
    background: var(--gray-100);
}

.language-switcher .dropdown-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.language-switcher .lang-flag {
    font-size: 1.3rem;
    line-height: 1;
}

.language-switcher .lang-name {
    font-weight: 500;
}

/* Footer Language List */
.footer-language .language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-language .lang-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border-radius: var(--radius);
    font-size: 1.4rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-language .lang-item:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.footer-language .lang-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Mobile Language Switcher */
@media (max-width: 767.98px) {
    .language-switcher .dropdown-toggle {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
    
    .language-switcher .lang-name.d-none {
        display: none !important;
    }
    
    .footer-language .lang-item {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* RTL Support for Arabic/Hebrew (future) */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .nav-link {
    text-align: right;
}

[dir="rtl"] .mega-menu-list a:hover {
    padding-left: 0;
    padding-right: 5px;
}

[dir="rtl"] .footer-links a:hover {
    padding-left: 0;
    padding-right: 5px;
}

/* Auto-detect indicator */
.language-auto-detected {
    font-size: 0.75rem;
    color: var(--gray-500);
    padding: 5px 15px;
    border-top: 1px solid var(--gray-200);
    margin-top: 5px;
}

/* Chinese font optimization */
html[lang="zh"] body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", var(--font-primary);
}

/* Greek font optimization */
html[lang="el"] body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, var(--font-primary);
}
