/*
Theme Name: DocPro Modern
Author: Gemini
Version: 18.1 (Fix 4 Columns Layout)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #10b981; --primary-dark: #059669; --primary-light: #d1fae5;
    --secondary: #f59e0b; --danger: #ef4444; --info: #06b6d4;
    --background: #f8fafc; --text-heading: #1e293b; --text-body: #475569;
    --border: #e2e8f0; --radius: 16px;
}

body {
    font-family: 'Inter', sans-serif; background-color: var(--background);
    color: var(--text-body); line-height: 1.6; padding-top: 80px;
    min-height: 100vh; display: flex; flex-direction: column;
}

a { text-decoration: none; transition: 0.2s; }

/* --- NAVBAR --- */
.modern-navbar {
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); padding: 10px 0; height: 70px; display: flex; align-items: center;
}
.logo-img { height: 45px !important; width: auto !important; max-width: 200px !important; object-fit: contain; }
.nav-link { font-weight: 600; color: #475569 !important; padding: 8px 16px !important; border-radius: 8px; font-size: 0.95rem; }
.nav-link:hover, .nav-link.active { color: var(--primary) !important; background: var(--primary-light); }
.btn-header-search { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: white; transition: 0.2s; }
.btn-header-search:hover { background-color: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.header-search-dropdown { position: fixed; top: 70px; left: 0; width: 100%; z-index: 1020; }

/* Fix Search Input */
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-results-button, input[type="search"]::-webkit-search-results-decoration { display: none; }
.header-search-input { padding-left: 50px !important; padding-right: 50px !important; height: 55px; font-size: 1.1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important; }
.header-search-icon { font-size: 1.2rem; pointer-events: none; }
.header-search-close { width: 35px; height: 35px; background-color: #f1f5f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; opacity: 1 !important; background-image: none !important; padding: 0; }
.header-search-close:hover { background-color: #e2e8f0; transform: rotate(90deg); }

/* --- HERO --- */
.hero-section { padding: 60px 0; background: white; position: relative; overflow: hidden; }
.hero-blob { position: absolute; width: 400px; height: 400px; background: var(--primary-light); filter: blur(80px); opacity: 0.6; border-radius: 50%; z-index: 0; }
.blob-1 { top: -100px; right: -100px; } .blob-2 { bottom: -100px; left: -100px; background: #fce7f3; }
.hero-content { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--primary-light); color: var(--primary-dark); border-radius: 100px; font-size: 0.85rem; font-weight: 600; margin-bottom: 24px; }
.search-container { background: white; border: 1px solid var(--border); padding: 6px; border-radius: 50px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); display: flex; gap: 10px; max-width: 500px; position: relative; z-index: 1; }
.search-container input { border: none; outline: none; box-shadow: none; font-size: 1rem; }
.search-container button { white-space: nowrap; min-width: fit-content; padding-left: 25px; padding-right: 25px; }

/* --- CHAT INTERFACE --- */
.ai-interface { background: white; border-radius: 24px; box-shadow: 0 20px 40px -5px rgba(0,0,0,0.1); border: 1px solid var(--border); height: 600px; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 2; }
.ai-header { padding: 15px 20px; border-bottom: 1px solid var(--border); background: #ffffff; display: flex; justify-content: space-between; align-items: center; z-index: 10; }
.ai-body { flex: 1; overflow-y: auto; padding: 20px; background: #f1f5f9; display: flex; flex-direction: column; gap: 15px; }
.ai-footer { padding: 15px 20px; border-top: 1px solid var(--border); background: white; }
.msg { display: flex; align-items: flex-end; gap: 10px; max-width: 100%; margin-bottom: 5px; }
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-bubble { background: var(--primary); color: white; border-radius: 18px 18px 4px 18px; box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2); }
.msg.user .msg-avatar { background: #dcfce7; color: var(--primary-dark); border: 2px solid white; }
.msg.bot { flex-direction: row; }
.msg.bot .msg-bubble { background: #ffffff; color: #1e293b; border-radius: 18px 18px 18px 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.msg.bot .msg-avatar { background: white; color: #2563eb; border: 1px solid #e2e8f0; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.msg-bubble { padding: 10px 16px; font-size: 0.95rem; line-height: 1.5; max-width: 90%; word-wrap: break-word; }
.msg-bubble img { max-width: 100%; border-radius: 8px; margin-top: 5px; }
.msg.user .msg-bubble ul { list-style: none; padding: 0; margin: 0; }

/* AI Block Colors */
.ai-block { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 10px; border-left: 4px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.ai-block.block-1 { border-left-color: #3b82f6; background: #eff6ff; }
.ai-block.block-2 { border-left-color: #f59e0b; background: #fffbeb; }
.ai-block.block-3 { border-left-color: #10b981; background: #f0fdf4; }
.ai-block.block-4 { border-left-color: #ef4444; background: #fef2f2; }
.ai-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }

/* --- TOOLS GRID (4 COLUMNS) --- */
.section-header { text-align: center; margin-bottom: 40px; max-width: 700px; margin: 0 auto 40px auto; }
.tools-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-bottom: 20px; }
.tool-item { background: white; border: 1px solid var(--border); border-radius: 20px; padding: 24px 15px; text-align: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; align-items: center; height: 100%; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.tool-item:hover { transform: translateY(-5px); box-shadow: 0 15px 30px -5px rgba(0,0,0,0.1); border-color: var(--primary); z-index: 10; }
.tool-icon { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 15px; transition: 0.3s; }
.tool-item:hover .tool-icon { transform: scale(1.1) rotate(5deg); }
.tool-name { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 4px; line-height: 1.3; }
.tool-desc { font-size: 0.8rem; color: #94a3b8; }
.bg-green { background: #dcfce7; color: #16a34a; } .bg-purple { background: #f3e8ff; color: #9333ea; } .bg-red { background: #fee2e2; color: #dc2626; } .bg-blue { background: #dbeafe; color: #2563eb; } .bg-indigo { background: #e0e7ff; color: #4338ca; } .bg-dark { background: #f1f5f9; color: #334155; } .bg-pink { background: #fce7f3; color: #db2777; } .bg-yellow { background: #fef9c3; color: #ca8a04; } .bg-orange { background: #ffedd5; color: #ea580c; } .bg-teal { background: #ccfbf1; color: #0d9488; } .bg-cyan { background: #cffafe; color: #0891b2; }

/* --- NEW DOC GRID SYSTEM (FIXED 4 COLUMNS) --- */
.doc-grid-system {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Ép cứng 4 cột */
    gap: 24px;
    width: 100%;
}

/* Card Style */
.doc-card {
    background: white; border: 1px solid #f1f5f9; border-radius: 20px;
    overflow: hidden; transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    height: 100%; display: flex; flex-direction: column;
}
.doc-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border-color: var(--primary-light); }
.doc-img { height: 160px; background: #f8fafc; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.doc-card:hover .doc-img img { transform: scale(1.05); }
.doc-type-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: white; font-size: 0.7rem; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.doc-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.doc-title a { color: #1e293b; font-weight: 700; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; margin-bottom: 8px; text-decoration: none; transition: 0.2s; }
.doc-title a:hover { color: var(--primary); }
.doc-btn-action { width: 100%; padding: 10px; border-radius: 12px; font-weight: 600; font-size: 0.9rem; text-align: center; background: #f1f5f9; color: #475569; transition: 0.2s; border: none; display: block; text-decoration: none; }
.doc-btn-action:hover { background: var(--primary); color: white; }

/* Header Modern */
.section-title-modern { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid #f1f5f9; }
.title-text { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; }
.text-gradient-primary { background: linear-gradient(90deg, #0061ff 0%, #60efff 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.text-gradient-warning { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- FOOTER --- */
footer { background: #1f2937; color: #9ca3af; padding: 20px 0; margin-top: auto; border-top: 1px solid rgba(255,255,255,0.05); }
.donate-modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.donate-modal[style*="display: flex"] { display: flex !important; }
.donate-modal-content { background: white; padding: 30px; border-radius: 20px; width: 90%; max-width: 600px; position: relative; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; }
.btn-donate { background-color: #ff6b6b; color: white; border: none; font-weight: 600; width: 100%; border-radius: 8px; padding: 10px; }
#btn-back-to-top { position: fixed; bottom: 30px; right: 30px; display: none; z-index: 1040; width: 45px; height: 45px; border-radius: 50%; border: none; background-color: var(--primary); color: white; align-items: center; justify-content: center; cursor: pointer; }

/* Responsive Rules */
@media (max-width: 1200px) { 
    .tools-grid-4, .doc-grid-system { grid-template-columns: repeat(3, 1fr); } 
}
@media (max-width: 991px) { 
    .tools-grid-4, .doc-grid-system { grid-template-columns: repeat(2, 1fr); }
    .hero-section { text-align: center; }
    .search-container { margin: 0 auto; }
}
@media (max-width: 576px) { 
    .doc-grid-system { grid-template-columns: 1fr; } 
}
@media (max-width: 768px) { .ai-interface { height: 500px; margin-top: 30px; } }