:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-hover: #7c3aed;
    --tab-inactive: rgba(255, 255, 255, 0.05);
    --tab-active: rgba(139, 92, 246, 0.2);
    --blob-1: #8b5cf6;
    --blob-2: #ec4899;
}

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

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

.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--blob-1);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background-color: var(--blob-2);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, 10%) scale(1.1); }
    66% { transform: translate(-5%, 5%) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 10;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

header {
    text-align: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 6px;
    position: relative;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--tab-active);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.number-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.number-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.number-display.highlight::before {
    opacity: 1;
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
    transition: opacity 0.3s ease;
}

.phone-number {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    color: white;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.5);
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(139, 92, 246, 0.6);
}

.action-btn:hover::after {
    opacity: 1;
}

.action-btn:active {
    transform: translateY(1px);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.action-btn:hover .btn-icon {
    transform: rotate(15deg) scale(1.1);
}

/* Animations for switching numbers */
.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Small loading animation state */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 30px 20px;
    }
    
    .phone-number {
        font-size: 1.4rem;
    }
}

/* --- Language Toggle & Khmer Fonts --- */
@font-face {
    font-family: 'KhmerHeading';
    src: url('font/heading-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'KhmerBody';
    src: url('font/body-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Apply Khmer fonts when active */
body.lang-kh h1, 
body.lang-kh .action-btn, 
body.lang-kh .phone-number {
    font-family: 'KhmerHeading', sans-serif !important;
    font-weight: normal !important;
}

body.lang-kh,
body.lang-kh p,
body.lang-kh .tab-btn,
body.lang-kh .placeholder-text {
    font-family: 'KhmerBody', sans-serif !important;
    font-weight: normal !important;
}

/* Lang toggle styling */
.lang-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: -16px; /* pull up slightly */
    z-index: 5;
    position: relative;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.lang-btn.active {
    color: var(--accent-primary);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-toggle .divider {
    color: var(--card-border);
    font-size: 0.8rem;
}

/* --- Toast Notification & Copying --- */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(139, 92, 246, 0.95);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.5);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.phone-number {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: color 0.3s;
}

.phone-number:hover {
    color: #e2e8f0;
}

.phone-number .copy-icon {
    opacity: 0;
    color: var(--accent-primary);
    transition: opacity 0.3s, transform 0.3s;
}

.phone-number:hover .copy-icon {
    opacity: 1;
    transform: scale(1.1);
}

.copy-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: -16px;
    margin-bottom: -8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-style: italic;
}

.copy-hint.visible {
    opacity: 1;
    visibility: visible;
}
