/* 
   Khmer Notes - Landing Page Stylesheet
   Theme: Elegant Dark/Light Glassmorphism
   Fonts: Outfit (Latin), Koh Santepheap & Battambang (Khmer)
*/

:root {
    /* Color Palette */
    --primary-hue: 243;
    --primary: hsl(var(--primary-hue), 75%, 59%);
    --primary-glow: hsla(var(--primary-hue), 75%, 59%, 0.35);
    --secondary-hue: 330;
    --secondary: hsl(var(--secondary-hue), 85%, 60%);
    --secondary-glow: hsla(var(--secondary-hue), 85%, 60%, 0.35);
    
    /* Semantic Colors */
    --bg: #090a0f;
    --bg-surface: rgba(20, 22, 37, 0.6);
    --bg-surface-border: rgba(255, 255, 255, 0.08);
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Layout Constants */
    --container-width: 1200px;
    --header-height: 80px;
    
    /* Fonts */
    --font-latin: 'Outfit', sans-serif;
    --font-khmer: 'Koh Santepheap', 'Battambang', sans-serif;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-latin);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Apply Khmer font to Khmer text blocks */
body, input, select, textarea, button {
    font-family: var(--font-khmer);
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Typography utility classes */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

p {
    color: var(--text-muted);
}

/* Header & Navigation */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-surface-border);
    background-color: rgba(9, 10, 15, 0.7);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-latin);
    letter-spacing: -0.5px;
}

.logo-icon {
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px hsla(var(--primary-hue), 75%, 59%, 0.5);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid var(--bg-surface-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 180px 0 100px 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
}

.glow-1 {
    top: -200px;
    left: -200px;
    background-color: var(--primary);
}

.glow-2 {
    bottom: -200px;
    right: -200px;
    background-color: var(--secondary);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

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

.badge {
    align-self: flex-start;
    padding: 6px 16px;
    background-color: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: #a5b4fc;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.15rem;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

/* Phone Mockup */
.hero-preview {
    display: flex;
    justify-content: center;
}

.phone-mockup {
    width: 320px;
    height: 640px;
    background-color: #1e1e24;
    border: 12px solid #2d2d35;
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.phone-speaker {
    width: 60px;
    height: 18px;
    background-color: #2d2d35;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: #0c0d14;
    display: flex;
    flex-direction: column;
    padding: 24px 16px 60px 16px;
    position: relative;
}

/* Phone App UI Elements */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.app-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-latin);
}

.app-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.app-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.app-stat-card {
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-purple {
    background-color: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.card-pink {
    background-color: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.app-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.app-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-surface-border);
    border-radius: 12px;
}

.app-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
}

.app-item-info {
    display: flex;
    flex-direction: column;
}

.app-item-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

.app-item-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.app-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 54px;
    background-color: #12131b;
    border-top: 1px solid var(--bg-surface-border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    justify-items: center;
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
}

.app-nav-item span {
    font-size: 0.55rem;
    margin-top: 2px;
}

.app-nav-item.active {
    color: var(--primary);
}

/* Features Section */
.features {
    padding: 100px 0;
    background-color: rgba(20, 22, 37, 0.2);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header h2 {
    font-size: 2.2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.bg-indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.bg-emerald {
    background: linear-gradient(135deg, #34d399, #059669);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.3);
}

.bg-pink {
    background: linear-gradient(135deg, #f472b6, #db2777);
    box-shadow: 0 8px 20px rgba(244, 114, 182, 0.3);
}

/* Demo / Live Playground Section */
.demo-section {
    padding: 100px 0;
}

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

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.demo-config {
    align-self: flex-start;
}

.config-header h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.inline-form {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-surface-border);
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: rgba(255, 255, 255, 0.08);
}

.demo-config input[type="number"] {
    width: 120px;
    text-align: center;
    font-weight: 600;
}

/* Summary Grid */
.demo-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.summary-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
}

.text-usd {
    color: #a5b4fc;
}

.text-khr {
    color: #fbcfe8;
}

.card-highlight {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(79, 70, 229, 0.4);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2);
}

.card-highlight .summary-title {
    color: #c7d2fe;
}

.card-highlight .summary-val {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Demo Main Table Dashboard */
.demo-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.demo-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.demo-table th, .demo-table td {
    padding: 16px;
    border-bottom: 1px solid var(--bg-surface-border);
}

.demo-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-table td {
    color: #ffffff;
    font-size: 0.95rem;
}

.demo-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge-currency {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-usd {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.badge-khr {
    background-color: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

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

.btn-delete:hover {
    color: var(--danger);
}

/* Guide Section */
.guide-section {
    padding: 100px 0;
    background-color: rgba(20, 22, 37, 0.2);
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.guide-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.guide-num {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(79, 70, 229, 0.15);
    position: absolute;
    top: 10px;
    right: 20px;
    font-family: var(--font-latin);
}

.guide-card h4 {
    font-size: 1.2rem;
    color: #ffffff;
}

/* Download / CTA Section */
.download-section {
    padding: 120px 0;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.download-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.15) 0%, rgba(9, 10, 15, 0.8) 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath fill-rule='evenodd' d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2v2h-2V0zm0 4h2v2h-2V4zm0 4h2v2h-2V8zm0 12h2v2h-2v-2zm0 12h2v2h-2v-2zm4-16h2v2h-2v-2zm4 0h2v2h-2v-2zm12 0h2v2h-2v-2zm12 0h2v2h-2v-2zM0 40h40v2H0v-2zm0 4h40v2H0v-4zm0 12h40v2H0v-2zm0 12h40v2H0v-2zm4-16h2v2h-2v-2zm4 0h2v2h-2v-2zm12 0h2v2h-2v-2zm12 0h2v2h-2v-2zm-36-8h2v2h-2v-2zm0-4h2v2h-2v-2zm0-12h2v2h-2v-2zm0-12h2v2h-2V0z'/%3E%3C/g%3E%3C/svg%3E");
}

.download-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.download-container h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.download-container p {
    font-size: 1.15rem;
}

.download-buttons {
    margin-top: 16px;
}

/* Footer */
.footer {
    background-color: #050608;
    border-top: 1px solid var(--bg-surface-border);
    padding: 80px 0 30px 0;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-info h3 {
    font-size: 1.4rem;
}

.footer-links h4, .footer-contact h4 {
    font-size: 1.05rem;
    color: #ffffff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-contact a {
    color: var(--primary);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--bg-surface-border);
    padding-top: 30px;
}

.footer-bottom p {
    font-size: 0.9rem;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #ffffff;
}

.form-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
}

.required {
    color: var(--danger);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Mobile responsive media queries */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content h1 {
        font-size: 2.4rem;
    }
    
    .badge {
        align-self: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .features-grid, .guide-cards {
        grid-template-columns: 1fr;
    }
    
    .demo-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #0c0d14;
        border-bottom: 1px solid var(--bg-surface-border);
        flex-direction: column;
        padding: 30px 0;
        gap: 20px;
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        pointer-events: none;
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .btn-nav {
        width: 80%;
    }
    
    .demo-summary-grid {
        grid-template-columns: 1fr;
    }
}
