/* ============================================
   QuangQuant - Personal Website Styles
   Clean, Minimal Dark Theme with Modern Background
   ============================================ */

:root {
    --color-bg: #0a0a0a;
    --color-bg-secondary: #111111;
    --color-bg-card: #1a1a1a;
    --color-border: #2a2a2a;
    --color-text: #ffffff;
    --color-text-muted: #888888;
    --color-accent: #00ff88;
    --color-accent-hover: #00cc6a;
    --color-danger: #ff4444;
    --color-success: #00ff88;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.page-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 255, 136, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 100, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-accent-hover);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent);
    color: #000;
    position: relative;
    overflow: hidden;
}

.btn-primary::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 0.5s ease;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-block {
    width: 100%;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
    width: 100%;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.logo img {
    height: 32px;
    width: auto;
}

.logo:hover {
    color: var(--color-text);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--color-text-muted);
    font-size: 14px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    cursor: pointer;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 140px 0 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    max-width: 100vw;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--color-accent);
}

.hero p {
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 255, 136, 0.1);
}

.card:hover::before {
    opacity: 1;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--color-accent);
    font-size: 24px;
}

.card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.card p {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ============================================
   Section
   ============================================ */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 30px;
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.auth-card {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--color-text-muted);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
}

.form-check-label {
    font-size: 14px;
    color: var(--color-text-muted);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.captcha-group {
    display: flex;
    justify-content: center;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-accent);
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Auth Icon */
.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--color-accent);
}

.auth-icon.success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--color-accent);
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: var(--radius);
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.info-box i {
    color: var(--color-accent);
    font-size: 18px;
    margin-top: 2px;
}

.info-box p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Forgot Password Link */
.forgot-link {
    font-size: 14px;
    color: var(--color-accent);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Social Login */
.social-login {
    margin-bottom: 20px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: var(--radius);
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #3c4043;
}

.btn-google:active {
    background: #f1f3f4;
}

.google-icon {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    gap: 15px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-divider span {
    color: var(--color-text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.form-error {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 4px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--color-accent);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 0 30px;
    margin-top: auto;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-brand img {
    height: 40px;
    width: auto;
}

.footer-brand p {
    color: var(--color-text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--color-text);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 18px;
}

.footer-social a:hover {
    background: var(--color-accent);
    color: #000;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ============================================
   Messages
   ============================================ */
.messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.messages .alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Page Content
   ============================================ */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--color-text-muted);
}

.page-content {
    padding: 60px 0;
}

.content-box {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.content-box h2 {
    font-size: 20px;
    margin: 30px 0 15px;
}

.content-box h2:first-child {
    margin-top: 0;
}

.content-box p {
    color: var(--color-text-muted);
    margin-bottom: 15px;
}

.content-box ul {
    color: var(--color-text-muted);
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-box li {
    margin-bottom: 8px;
}

/* ============================================
   Contact
   ============================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    color: var(--color-text-muted);
}

.contact-item i {
    width: 40px;
    height: 40px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}

/* ============================================
   Profile Page
   ============================================ */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--color-text-muted);
}

.profile-info {
    flex-grow: 1;
}

.profile-info h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.profile-info .username {
    color: var(--color-accent);
    font-size: 14px;
    margin-bottom: 5px;
}

.profile-info .member-since {
    color: var(--color-text-muted);
    font-size: 13px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-card {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 25px;
    transition: all 0.3s ease;
}

.profile-card:hover {
    border-color: rgba(0, 255, 136, 0.2);
}

.profile-card.full-width {
    grid-column: 1 / -1;
}

.profile-card h3 {
    font-size: 16px;
    color: var(--color-accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    color: var(--color-text-muted);
    font-size: 14px;
}

.profile-field span {
    font-size: 14px;
}

.bio-text {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* API Keys */
.api-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-field label {
    color: var(--color-text-muted);
    font-size: 14px;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-bg);
    padding: 10px 15px;
    border-radius: var(--radius);
    overflow: hidden;
}

.api-key-display code {
    font-size: 12px;
    color: var(--color-accent);
    word-break: break-all;
    flex-grow: 1;
}

.btn-copy {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.btn-copy:hover {
    color: var(--color-accent);
}

.not-generated {
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 14px;
}

.generate-form {
    display: inline-block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Verification Notice */
.verification-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-top: 15px;
    font-size: 14px;
    color: #ff6b6b;
}

.verification-notice i {
    font-size: 16px;
}

.verification-notice span {
    flex-grow: 1;
}

/* Email Verified Badge */
.verified-badge {
    color: var(--color-accent);
    font-size: 14px;
}

.unverified-badge {
    color: var(--color-danger);
    font-size: 14px;
}

/* Form Container */
.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.profile-form {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h3 {
    font-size: 16px;
    color: var(--color-accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.required {
    color: var(--color-danger);
}

.current-avatar {
    margin-bottom: 10px;
}

.current-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* Auth Card Wide (for signup) */
.auth-card-wide {
    max-width: 550px;
}

/* User link in nav */
.user-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-link i {
    font-size: 18px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-user {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-user .btn {
        width: 100%;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
