@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f1f5f9; /* Slate-100 สำหรับตัดหลังการ์ดขาว */
    --card-bg: #ffffff; /* ขาวบริสุทธิ์เพื่อ Contrast สูงสุด */
    --card-border: #cbd5e1; /* Slate-300 กรอบการ์ดชัดเจน */
    --text-primary: #0f172a; /* Slate-900 เกือบดำสนิท */
    --text-secondary: #475569; /* Slate-600 เทาเข้มอ่านง่าย */
    --line-color: #4f46e5; /* สีหลักของระบบ (Indigo) */
    --line-hover: #4338ca;
    --line-glow: rgba(79, 70, 229, 0.15);
    --danger-color: #dc2626; /* แดงเข้ม */
    --danger-hover: #b91c1c;
    --input-bg: #ffffff;
    --input-border: #94a3b8; /* Slate-400 กรอบอินพุตชัดเจน */
    --input-text: #0f172a;
    --input-focus-border: #4f46e5; /* Indigo-600 */
    --font-sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background elements for depth (Light Theme soft glow) */
body::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(241, 245, 249, 0) 70%);
    top: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(241, 245, 249, 0) 70%);
    bottom: -150px;
    left: -150px;
    z-index: -1;
    pointer-events: none;
}

/* Global Glass Card Style */
.glass-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 16px -6px rgba(15, 23, 42, 0.04);
    text-align: center;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeIn 0.8s ease forwards;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.12), 0 0 30px rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.3);
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #0f172a 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Logo Design */
.logo-container {
    margin-bottom: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: rgba(79, 70, 229, 0.08);
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-radius: 50px;
    position: relative;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.05);
}

.logo-container svg {
    width: 44px;
    height: 44px;
    fill: var(--line-color);
}

/* LINE Login Button */
.btn-line-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--line-color);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--line-glow);
    position: relative;
    overflow: hidden;
}

.btn-line-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out;
    pointer-events: none;
}

.btn-line-login:hover {
    background-color: var(--line-hover);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3), 0 0 15px var(--line-color);
    transform: scale(1.02);
}

.btn-line-login:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.btn-line-login svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.btn-line-login img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Microsoft Login Button */
.btn-ms-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: #ffffff;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.btn-ms-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0) 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out;
    pointer-events: none;
}

.btn-ms-login:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
    transform: scale(1.02);
}

.btn-ms-login:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.btn-ms-login svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* User Profile Section */
.profile-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--line-color);
    box-shadow: 0 0 25px rgba(79, 70, 229, 0.2);
    transition: all 0.3s ease;
}

.profile-avatar-container:hover .profile-avatar {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.3);
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.user-status {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 24px;
    background: rgba(15, 23, 42, 0.04);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* Info Table / List */
.info-list {
    text-align: left;
    margin-bottom: 30px;
}

.info-item {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.3s;
}

.info-item:hover {
    background: rgba(15, 23, 42, 0.04);
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.info-value-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    font-weight: 500;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.btn-copy:hover {
    color: var(--line-color);
}

.btn-copy svg {
    width: 16px;
    height: 16px;
}

/* Logout Button */
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: transparent;
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: var(--danger-color);
    color: #ffffff;
    border-color: var(--danger-color);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
    transform: scale(1.01);
}

/* Technical Details Toggle */
.details-toggle {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
}

.raw-json-container {
    margin-top: 15px;
    display: none;
    background: #0f172a;
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    max-height: 180px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
    border: 1px solid rgba(0,0,0,0.1);
}

.raw-json-container::-webkit-scrollbar {
    width: 6px;
}

.raw-json-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.raw-json-container pre {
    white-space: pre-wrap;
    word-break: break-all;
    color: #a5b4fc;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustment for dashboard on wider viewports */
@media (min-width: 640px) {
    .glass-card.dashboard-card {
        max-width: 600px;
        padding: 48px;
    }
}

/* Responsive adjustment for auth cards (login/signup/pending) on mobile */
@media (max-width: 480px) {
    body { padding: 16px; align-items: flex-start; }
    .glass-card {
        padding: 28px 20px !important;
        border-radius: 18px !important;
    }
    h1 { font-size: 22px !important; }
}
