:root {
    /* Color Palette - Premium & Modern */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
    --font-body: 'Inter', 'Noto Sans JP', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 500px; /* Mobile focused */
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Glassmorphism Effect */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 70px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    transition: all 0.3s ease;
}

.nav-item i {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

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

.nav-item:active {
    transform: scale(0.9);
}

/* Loading Screen */
.loading-screen {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typography Helper */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

/* Result Card Extra Polish */
.result-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-card:hover {
    transform: translateY(-5px);
}

/* Share Button Animation */
#share-btn:active {
    background: var(--primary-light);
    transform: scale(0.95);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5) !important;
}
.premium-btn:active {
    transform: scale(0.98);
}

/* Page Transitions */
.page {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Form Inputs - Mobile friendly */
input[type="date"],
input[type="text"],
select {
    appearance: none;
    -webkit-appearance: none;
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 48px; /* Touch-friendly */
}

input[type="date"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Submit / Action Buttons */
button[type="submit"] {
    border-radius: 16px;
    font-size: 1.05rem;
    min-height: 52px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

button[type="submit"]:active {
    transform: scale(0.97);
}

/* Disabled Button State */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Calendar Day Cells */
.calendar-day {
    min-height: 60px;
    cursor: default;
    transition: background 0.2s;
}

/* Compatibility Bar Animation */
@keyframes barGrow {
    from { width: 0%; }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}

/* Select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
