/* ========================================
   Vietnam Novel Template - Third Edition
   Brand New Design - Completely Different
   ======================================== */

/* CSS Variables for New Theme */
:root {
    --primary-gradient: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    --secondary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --accent-gradient: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
    --dark-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Container */
.vn-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HEADER - New Modern Design
   ======================================== */

.vn-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.vn-header-top {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 0;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.vn-header-main {
    padding: 20px 0;
}

.vn-header-main .vn-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo - New Style */
.vn-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: var(--transition);
}

.vn-logo:hover {
    transform: translateY(-2px);
}

.vn-logo img {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--primary-gradient) border-box;
}

.vn-logo h1 {
    font-size: 26px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Search Box - New Floating Design */
.vn-search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.vn-search-box form {
    position: relative;
}

.vn-search-box input[type="text"] {
    width: 100%;
    padding: 16px 24px;
    padding-right: 50px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-size: 15px;
    background: white;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.vn-search-box input[type="text"]:focus {
    outline: none;
    border-color: #00b4db;
    box-shadow: 0 8px 30px rgba(0, 180, 219, 0.2);
}

.vn-search-box::after {
    content: "🔍";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

/* User Area - New Pill Design */
.vn-user-area {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vn-btn-login,
.vn-btn-register {
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vn-btn-login {
    background: white;
    color: #0083b0;
    border: 2px solid #e2e8f0;
}

.vn-btn-login:hover {
    border-color: #00b4db;
    color: #00b4db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.vn-btn-register {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.vn-btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 180, 219, 0.4);
}

/* Navigation - New Floating Pills */
.vn-nav {
    background: transparent;
    padding: 15px 0;
}

.vn-nav .vn-container {
    display: flex;
    justify-content: center;
}

.vn-nav ul {
    display: flex;
    gap: 10px;
    list-style: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
}

.vn-nav li a {
    display: block;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    white-space: nowrap;
}

.vn-nav li a:hover,
.vn-nav li a.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 180, 219, 0.3);
}

/* ========================================
   MAIN CONTENT - New Card Design
   ======================================== */

.vn-main {
    padding: 40px 0;
}

.vn-section {
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.vn-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.vn-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.vn-section-title {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vn-section-more {
    color: #0083b0;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.vn-section-more:hover {
    color: #00b4db;
    transform: translateX(5px);
}

/* ========================================
   BOOK GRID - New Masonry Style
   ======================================== */

.vn-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}

.vn-book-item {
    transition: var(--transition);
}

.vn-book-item:hover {
    transform: translateY(-8px);
}

.vn-book-cover {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.vn-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.vn-book-item:hover .vn-book-cover img {
    transform: scale(1.1);
}

.vn-book-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vn-book-item:hover .vn-book-cover::after {
    opacity: 1;
}

.vn-book-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.vn-book-title a {
    color: #1e293b;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.vn-book-title a:hover {
    color: #0083b0;
}

.vn-book-author {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   FOOTER - New Dark Design
   ======================================== */

.vn-footer {
    background: var(--dark-gradient);
    color: #cbd5e1;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.vn-footer-main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.vn-footer-section h4 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vn-footer-section ul {
    list-style: none;
}

.vn-footer-section li {
    margin-bottom: 12px;
}

.vn-footer-section a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vn-footer-section a:hover {
    color: #38bdf8;
    transform: translateX(5px);
}

.vn-footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #64748b;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .vn-book-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 992px) {
    .vn-header-main .vn-container {
        flex-wrap: wrap;
    }
    
    .vn-search-box {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }
    
    .vn-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .vn-footer-main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .vn-container {
        padding: 0 16px;
    }
    
    .vn-logo h1 {
        font-size: 20px;
    }
    
    .vn-btn-login,
    .vn-btn-register {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .vn-nav li a {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .vn-section {
        padding: 20px;
    }
    
    .vn-book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .vn-footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .vn-book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vn-user-area {
        gap: 8px;
    }
    
    .vn-btn-login,
    .vn-btn-register {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.vn-text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vn-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.vn-badge-primary {
    background: rgba(0, 180, 219, 0.1);
    color: #0083b0;
}

.vn-badge-success {
    background: rgba(17, 153, 142, 0.1);
    color: #11998e;
}

.vn-badge-warning {
    background: rgba(252, 74, 26, 0.1);
    color: #fc4a1a;
}
