/* --- CORE VARIABLES (Same as Index) --- */
:root {
    --bs-primary: #0ea5e9;
    --bs-primary-rgb: 14, 165, 233;
    --bs-secondary: #64748b;
    --bs-dark: #0f172a;
    --bs-light: #f8fafc;
    --bs-body-font-family: 'Be Vietnam Pro', sans-serif;
    
    --brand-600: #0284c7;
    --brand-500: #0ea5e9;
    --accent-600: #7c3aed;
}

body {
    height: 100vh;
    overflow-x: hidden;
    background-color: var(--bs-light);
}
/* --- Custom Utilities --- */
.text-gradient {
    background: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
/* Glassmorphism for Testimonial */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Input Styling with Icons */
.input-group-custom {
    position: relative;
}
.input-group-custom .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary);
    z-index: 5;
    pointer-events: none;
    transition: color 0.3s;
}
.form-control-custom {
    padding: 0.8rem 1rem 0.8rem 1rem; /* Default padding */
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.form-control-custom.has-icon {
    padding-left: 3rem; /* Extra padding for icon */
}
.form-control-custom:focus {
    background-color: #fff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}
.input-group-custom:focus-within .input-icon {
    color: var(--brand-500);
}

/* Social Buttons */
.btn-social {
    background-color: white;
    border: 1px solid #e2e8f0;
    color: var(--bs-secondary);
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-social:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
}
/* Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    z-index: 0;
}
/* Layout Helpers */
.h-screen-mobile-auto {
    height: 100vh;
}
@media (max-width: 991.98px) {
    .h-screen-mobile-auto {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    body { overflow: auto; }
}

[x-cloak] { display: none !important; }
/* Tool Cards */
.tool-card {
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 1.5rem;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.tool-card.active {
    border: 2px solid var(--brand-500);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.1);
    transform: scale(1.02);
}
.tool-card .corner-blob {
    position: absolute;
    top: 0; right: 0;
    width: 6rem; height: 6rem;
    border-bottom-left-radius: 9999px;
    margin-right: -1.5rem; margin-top: -1.5rem;
    transition: transform 0.3s;
}
.tool-card:hover .corner-blob {
    transform: scale(1.1);
}

/* Workspace */
.workspace-container {
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    background: white;
    overflow: hidden;
    min-height: 600px;
}

/* Editor */
.editor-textarea {
    border: none;
    outline: none;
    box-shadow: none;
    resize: none;
    font-size: 1.125rem;
    line-height: 1.75;
    color: #334155;
    background: transparent;
}
.editor-textarea:focus {
    box-shadow: none;
    background: transparent;
}

/* Background Ambience */
.bg-ambience-1 {
    position: absolute; top: 0; left: 25%;
    width: 800px; height: 800px;
    background: rgba(14, 165, 233, 0.15);
    border-radius: 50%;
    filter: blur(120px);
    mix-blend-mode: multiply;
    z-index: -1;
    animation: float 6s ease-in-out infinite;
}
.bg-ambience-2 {
    position: absolute; bottom: 0; right: 25%;
    width: 600px; height: 600px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    filter: blur(100px);
    mix-blend-mode: multiply;
    z-index: -1;
    animation: float 6s ease-in-out infinite 2s;
}
/* Horizontal Scroll for Mobile Tools */
.scroll-snap-x {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}
.scroll-snap-x::-webkit-scrollbar { display: none; }
.snap-center { scroll-snap-align: center; }

/* Bootstrap Overrides */
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }

.nav-link-custom {
    color: var(--bs-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-link-custom:hover {
    color: var(--bs-dark);
    background-color: rgba(255,255,255,0.5);
}

.btn-brand {
    background-color: var(--bs-dark);
    color: white;
    font-weight: bold;
    border-radius: 0.75rem;
    padding: 0.75rem 2rem;
    transition: all 0.2s;
}
.btn-brand:hover {
    background-color: var(--brand-600);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
    background-color: var(--bs-primary-bg-subtle, #e0f2fe);
    color: var(--bs-primary, #0ea5e9);
}
.mobile-nav-link i {
    margin-right: 12px;
}
div:where(.swal2-container).swal2-center>.swal2-popup{
    border-radius: 60px;
}
/* Hiệu ứng chuyển đổi mượt mà */
.transition-all { transition: all 0.3s ease; }

/* Hiệu ứng Nổi/Chìm (Neumorphism) */
.glass-card { background: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 10px 30px -5px rgba(0,0,0,0.03); }
.hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.08); }

/* Highlight Thông Minh (Đã thêm Xanh lá cho Người viết) */
.hl-block { transition: all 0.2s; cursor: pointer; position: relative; color: #1e293b; }
.hl-block:hover { filter: brightness(0.9); z-index: 10; }

.bg-ai-high { background-color: rgba(239, 68, 68, 0.15) !important; } /* Đỏ: AI > 80% */
.bg-ai-med  { background-color: rgba(245, 158, 11, 0.2) !important; }  /* Vàng: AI > 40% */
.bg-ai-low  { background-color: rgba(34, 197, 94, 0.12) !important; } /* Xanh lá siêu dịu: Người viết */

/* Gạch chân cảnh báo */
.err-plagiarism { border-bottom: 2px dashed #fd7e14 !important; }
.err-grammar { text-decoration: underline wavy #dc3545 !important; text-underline-offset: 4px; font-weight: 600;}

/* Nút Gradient PDF */
.btn-gradient { background: linear-gradient(135deg, #6366f1, #3b82f6); color: white; border: none; }
.btn-gradient:hover { background: linear-gradient(135deg, #4f46e5, #2563eb); color: white; }

.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }