/* Modern CSS cho website bán key - Enhanced Version */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Enhanced Beautiful Gradient Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #7c8ef0 0%, #8a5fb8 100%);
    --secondary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --success-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --ocean-gradient: linear-gradient(135deg, #667eea 0%, #06b6d4 100%);
    --sunset-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --fire-gradient: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    
    /* Clean White Glass Morphism */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-glass-light: rgba(255, 255, 255, 0.95);
    --bg-glass-strong: rgba(255, 255, 255, 0.98);
    
    /* Clear Text Hierarchy */
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-accent: #ef4444;
    
    /* Clean Borders */
    --border-primary: rgba(59, 130, 246, 0.2);
    --border-secondary: rgba(16, 185, 129, 0.2);
    --border-muted: rgba(209, 213, 219, 0.3);
    --border-glass: rgba(255, 255, 255, 0.8);
    
    /* Enhanced Beautiful Shadows & Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15), 0 15px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.2), 0 0 60px rgba(16, 185, 129, 0.15);
    --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(236, 72, 153, 0.4);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --shadow-primary: 0 10px 30px rgba(102, 126, 234, 0.3), 0 5px 15px rgba(118, 75, 162, 0.2);
    --shadow-success: 0 10px 30px rgba(16, 185, 129, 0.3), 0 5px 15px rgba(5, 150, 105, 0.2);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    color: var(--text-secondary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global readable text override */
h1, h2, h3, h4, h5, h6,
p, li, dt, dd, th, td, label, span, a,
input, textarea, select, button {
    color: #111 !important;
    text-shadow: none !important;
}

/* Keep buttons that are intentionally colored (primary, success, danger) with white text */
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-outline:hover {
    color: #fff !important;
}

/* Muted / secondary text utility */
.text-muted { color: #6b7280 !important; }
.text-secondary { color: #374151 !important; }

/* Link base style */
a { text-decoration: none; color: #1d4ed8; }
a:hover { color: #1e40af; }

/* Table header subtle tone */
th { font-weight:600; background:#f8fafc; }

@keyframes gradient-dance {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Magical Background Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: -1;
    backdrop-filter: blur(1px);
    animation: magical-float 20s ease-in-out infinite;
}

@keyframes magical-float {
    0%, 100% { 
        opacity: 0.8;
        transform: translateY(0px) rotate(0deg);
    }
    50% { 
        opacity: 1;
        transform: translateY(-20px) rotate(2deg);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(147, 197, 253, 0.003) 2px,
            rgba(147, 197, 253, 0.003) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(167, 139, 250, 0.003) 2px,
            rgba(167, 139, 250, 0.003) 4px
        );
    z-index: -1;
    opacity: 0.3;
}

@keyframes aurora-enhanced {
    0%, 100% { 
        opacity: 0.4; 
        transform: rotate(0deg) scale(1) translateY(0px); 
    }
    25% { 
        opacity: 0.8; 
        transform: rotate(2deg) scale(1.05) translateY(-10px); 
    }
    50% { 
        opacity: 0.6; 
        transform: rotate(-1deg) scale(0.95) translateY(-5px); 
    }
    75% { 
        opacity: 0.9; 
        transform: rotate(1deg) scale(1.02) translateY(-15px); 
    }
}

/* Floating Elements */
.floating-element {
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

.floating-element:nth-child(1) {
    top: 20%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(241, 245, 249, 0.1), transparent);
    border-radius: 50%;
    animation: float-1 12s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    top: 60%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(248, 250, 252, 0.1), transparent);
    border-radius: 50%;
    animation: float-2 15s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

@keyframes float-2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-50px) rotate(-180deg); }
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Clean Text */
.gradient-text {
    color: #1f2937;
    font-weight: 800;
}

@keyframes text-rainbow {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

@keyframes gradient-shift {
    0% { filter: hue-rotate(0deg) brightness(1); }
    100% { filter: hue-rotate(10deg) brightness(1.1); }
}

/* Enhanced Container System */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-xl);
}

/* Enhanced Grid System */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto-fit { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* Stunning Glass Morphism Cards */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(40px) saturate(180%);
    border: 2px solid var(--border-glass);
    border-radius: 24px;
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-lg);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.2) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-2xl), var(--shadow-primary);
    backdrop-filter: blur(50px) saturate(200%);
}

.card:hover::before {
    opacity: 1;
    background: linear-gradient(45deg, 
        rgba(203, 213, 225, 0.1), 
        rgba(226, 232, 240, 0.08), 
        rgba(241, 245, 249, 0.1));
    background-size: 200% 200%;
    animation: rainbow-border 3s linear infinite;
}

.card:hover::after {
    opacity: 1;
}

@keyframes rainbow-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border-muted);
    box-shadow: var(--shadow-sm);
}

.card-glass:hover {
    background: var(--bg-glass-light);
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-md);
}

/* Enhanced Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
    z-index: 0;
}

.btn:hover::before {
    left: 100%;
}

.btn > * {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: var(--primary-gradient);
    background-size: 200% 200%;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-2xl), 0 0 40px rgba(102, 126, 234, 0.4);
    background: var(--primary-gradient-hover);
    background-position: 100% 0;
    animation: button-glow 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

@keyframes button-glow {
    0% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.3) saturate(1.5); }
    100% { filter: brightness(1.2) saturate(1.3); }
}

.btn-secondary {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    border: 2px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(156, 163, 175, 0.3) 0%, transparent 70%);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.btn-secondary:hover {
    background: var(--bg-glass-light);
    color: var(--text-primary);
    border-color: var(--border-primary);
    transform: translateY(-6px) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(255, 107, 107, 0.3);
}

.btn-secondary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-success {
    background: var(--success-gradient);
    background-size: 200% 200%;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-md);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: success-pulse 3s ease-in-out infinite;
}

@keyframes success-pulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-success:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 184, 148, 0.5), 0 5px 15px rgba(129, 236, 236, 0.3);
    filter: brightness(1.2) saturate(1.3);
    animation: success-glow 0.6s ease;
}

@keyframes success-glow {
    0%, 100% { box-shadow: 0 15px 40px rgba(0, 184, 148, 0.5); }
    50% { box-shadow: 0 20px 60px rgba(0, 184, 148, 0.8), 0 0 30px rgba(129, 236, 236, 0.6); }
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: -1;
}

.btn-outline:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-outline:hover::before {
    opacity: 1;
}

/* Enhanced Form System */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: #ffffff;
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-muted);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.form-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    backdrop-filter: blur(30px);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.form-input:focus::placeholder {
    color: transparent;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert System */
.alert {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid;
    backdrop-filter: blur(10px);
}

.alert {
    backdrop-filter: blur(25px) saturate(180%);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    animation: alert-slide-in 0.5s ease-out;
}

@keyframes alert-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-success {
    background: linear-gradient(135deg, rgba(134, 239, 172, 0.2), rgba(187, 247, 208, 0.15));
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(10px);
}

.alert-error {
    background: linear-gradient(135deg, rgba(252, 165, 165, 0.2), rgba(249, 168, 212, 0.15));
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
    backdrop-filter: blur(10px);
}

.alert-info {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.2), rgba(167, 139, 250, 0.15));
    border: 2px solid rgba(59, 130, 246, 0.3);
    color: #1e40af;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(10px);
}

/* Enhanced Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.mt-auto { margin-top: auto; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 0 var(--space-lg);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 968px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: 0.85rem;
    }
    
    .card {
        padding: var(--space-lg);
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }
    
    .btn {
        border: 1px solid black;
        background: white;
        color: black;
    }
}