:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #0f111a;
    --bg-card: rgba(25, 27, 36, 0.65);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.2);
    --success: #10b981;
    --danger: #ef4444;
    --font-family: 'Sarabun', sans-serif;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

body.light-theme {
    --primary: #003399;
    --primary-hover: #002266;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: rgba(0, 0, 33, 0.1);
    --input-bg: rgba(255, 255, 255, 1);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body.dark-theme, body.light-theme {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    background-attachment: fixed;
    line-height: 1.5;
}

body.dark-theme {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
}

body.light-theme {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 15px;
}

.app-header {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.logo .mvit {
    color: #003399;
    background: linear-gradient(135deg, #003399, #0055ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .logo .mvit {
    background: linear-gradient(135deg, #003399, #0044bb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo {
    color: var(--text-main);
}

body.light-theme .logo {
    color: #003399; /* Match secondary part to logo blue or primary */
}

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

.glassmorphism {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 15px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

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

input[type="text"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
    transition: 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-upload-box {
    border: 2px dashed rgba(99, 102, 241, 0.5);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
}

.btn-secondary {
    background: rgba(0, 51, 153, 0.05);
    color: #003399;
    border: 1px solid rgba(0, 51, 153, 0.2);
}

.btn-secondary:hover {
    background: rgba(0, 51, 153, 0.1);
}

body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
}

.status-msg {
    margin: 15px 0;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.status-msg.success {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-msg.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.loader {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

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

.hidden { display: none; }

.mt-20 { margin-top: 20px; }

.photo-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.example-card img {
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
    height: auto;
    max-height: 300px;
    background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .example-card img {
    background: rgba(255, 255, 255, 0.05);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.badge-good { background: var(--success); color: white; }
.badge-bad { background: var(--danger); color: white; }

.app-footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Upload Progress Styles */
.upload-progress-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 51, 153, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 500;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
}

body.dark-theme .progress-bar-bg {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #003399, #0066ff);
    transition: width 0.3s ease;
    border-radius: 20px;
}

/* Responsive Adjustments for Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
        white-space: nowrap;
        letter-spacing: -0.2px;
    }
    
    .header-content {
        gap: 10px;
    }
    
    .header-logo {
        width: 50px;
        height: 50px;
    }

    .subtitle {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}
