/* CSS Reset and Base Styles - Optimized for performance */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Layout containers - Performance optimized */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    contain: layout style;
}

/* Professional Header Design */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 100;
    border-bottom: 3px solid #5a67d8;
    animation: headerSlideIn 0.8s ease-out;
}

@keyframes headerSlideIn {
    from {
        transform: translate3d(0, -100%, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 25%, 
        transparent 50%, 
        rgba(102, 126, 234, 0.1) 75%, 
        rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.logo-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.logo-link:hover::before {
    left: 100%;
}

.logo-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.logo-link:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffd700, #ffed4a);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.nav-link.active::after {
    width: 100%;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Close Button - Hidden on desktop */
.nav-close {
    display: none;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.4s;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
    background-color: #ffd700;
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
    background-color: #ffd700;
}

/* Header Content */
.header-content {
    text-align: center;
    padding: 3rem 0 4rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    margin-top: 1rem;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: contentFadeIn 1s ease-out 0.3s both;
}

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

.header-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

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

.page-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #ffd700 50%, #f0f8ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.2));
    }
    to {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 30px rgba(255, 215, 0, 0.4));
    }
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Main content */
.main {
    padding: 3rem 0;
}

/* Cards */
.calculator-card,
.results-card,
.game-info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculator-card:hover,
.results-card:hover,
.game-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f7fafc;
}

.card-header h2,
.card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* Forms */
.calculator-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-input,
.form-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    color: #2d3748;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:invalid,
.form-select:invalid {
    border-color: #e53e3e;
}

.form-help {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

.error-message {
    font-size: 0.875rem;
    color: #e53e3e;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Checkbox styles */
.checkbox-group {
    border: none;
    padding: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.form-checkbox:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

/* Button styles */
.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.info-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.info-button:hover {
    background-color: #f7fafc;
}

.info-icon {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Results section */
.results-content {
    display: grid;
    gap: 2rem;
}

.result-main {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.result-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.result-unit {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
}

.result-formula {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.result-details,
.result-comparison {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.detail-item,
.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item:last-child,
.comparison-item:last-child {
    border-bottom: none;
}

.detail-label,
.comparison-label {
    font-weight: 600;
    color: #2d3748;
}

.detail-value,
.comparison-value {
    font-weight: 500;
    color: #4a5568;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-low {
    background-color: #c6f6d5;
    color: #276749;
}

.status-medium {
    background-color: #fef5e7;
    color: #c05621;
}

.status-high {
    background-color: #fed7d7;
    color: #c53030;
}

.status-optimal {
    background-color: #bee3f8;
    color: #2a69ac;
}

/* Main Educational Content */
.main-content-section {
    margin: 4rem 0;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* Intro Section */
.intro-section {
    text-align: center;
    margin-bottom: 4rem;
}

.intro-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.intro-text {
    font-size: 1.2rem;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.highlight-text {
    font-size: 1.1rem;
    color: #ffd700;
    font-weight: 600;
    margin-top: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Concepts Section */
.concepts-section {
    margin-bottom: 4rem;
}

.concepts-section h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.concept-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.concept-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.concept-card.featured {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.concept-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.concept-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.concept-header h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.concept-content p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.concept-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.concept-list li {
    padding: 0.5rem 0;
    color: #4a5568;
    border-bottom: 1px solid #f7fafc;
}

.concept-list li:last-child {
    border-bottom: none;
}

.sensitivity-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.format-item {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.pro-tip {
    background: linear-gradient(135deg, #fff5e6 0%, #fef7ed 100%);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #f6ad55;
    margin-top: 1rem;
    color: #744210;
}

.formula-display {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.formula {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.formula-note {
    font-size: 0.9rem;
    opacity: 0.9;
}

.example-calculation {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    color: #2d3748;
}

.example-calculation h5 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-weight: 600;
}

.example-calculation .highlight {
    color: #667eea;
    font-weight: 700;
}

.example-result {
    font-weight: 600;
    color: #38a169;
    margin-top: 1rem;
    font-style: italic;
}

/* Game Recommendations */
.game-recommendations {
    margin-bottom: 4rem;
}

.game-recommendations h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-intro {
    text-align: center;
    color: #ffffff;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-recommendation-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-recommendation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f7fafc;
}

.game-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.average-edpi {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    background: #f0f4ff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.edpi-range {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.range-item {
    padding: 0.5rem;
    text-align: center;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.range-item.low {
    background: #c6f6d5;
    color: #276749;
}

.range-item.medium {
    background: #bee3f8;
    color: #2a69ac;
}

.range-item.high {
    background: #fed7d7;
    color: #c53030;
}

.game-description {
    color: #4a5568;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Usage Guide */
.usage-guide {
    margin-bottom: 4rem;
}

.usage-guide h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.step-by-step {
    display: grid;
    gap: 1.5rem;
}

.step {
    display: flex;
    align-items: flex-start;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.step-content p {
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 4rem;
}

.faq-section h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.faq-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.faq-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1rem 0;
}

.faq-item p {
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
}

/* Quick Reference */
.quick-reference {
    margin: 4rem 0;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.reference-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reference-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.reference-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.reference-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.reference-card p {
    color: #4a5568;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Game information */
.game-info-content {
    display: grid;
    gap: 1.5rem;
}

.game-spec {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Tooltip */
.tooltip {
    position: absolute;
    z-index: 1000;
    background: #2d3748;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip-arrow.top {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0 5px;
    border-color: #2d3748 transparent transparent transparent;
}

.tooltip-arrow.bottom {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-color: transparent transparent #2d3748 transparent;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
}

.spinner {
    border: 4px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Footer */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-brand p {
    color: #cbd5e0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-links-section h5,
.footer-games h5 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #667eea;
}

.footer-game-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-tag {
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.footer-keywords {
    color: #718096;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    /* Mobile Navigation */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 9999;
        border-top: 3px solid #ffd700;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    /* Close Button */
    .nav-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        z-index: 10000;
    }

    .nav-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1) rotate(90deg);
        border-color: #ffd700;
    }

    .nav-close span {
        font-weight: 300;
        line-height: 1;
    }

    .nav-list {
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        height: 100%;
        justify-content: flex-start;
        align-items: center;
        flex: 1;
    }

    .nav-item {
        text-align: center;
        margin: 0;
        width: 100%;
        max-width: 300px;
    }

    .nav-link {
        display: block;
        padding: 1.5rem 2rem;
        font-size: 1.3rem;
        border-radius: 15px;
        border: none;
        background: rgba(255, 255, 255, 0.15);
        margin-bottom: 0;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.9);
        transition: all 0.3s ease;
        width: 100%;
        text-align: center;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.3);
        color: white;
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }

    .nav-link.active {
        background: rgba(255, 215, 0, 0.3);
        color: white;
        font-weight: 700;
        border: 2px solid rgba(255, 215, 0, 0.5);
    }

    .nav-link.active::before {
        display: none;
    }

    /* Overlay Background */
    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
        animation: rotate 15s linear infinite;
        pointer-events: none;
    }

    /* Header Content Mobile */
    .header-content {
        padding: 2rem 0 2.5rem;
        margin-top: 0.5rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .logo-icon {
        font-size: 1.6rem;
    }

    .main {
        padding: 2rem 0;
    }

    .calculator-card,
    .results-card,
    .game-info-card {
        padding: 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 1.25rem;
    }

    .result-main {
        padding: 1.5rem;
    }

    .result-number {
        font-size: 2.5rem;
    }

    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-game-links {
        justify-content: center;
    }

    .footer-links {
        align-items: center;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    .key-benefits {
        grid-template-columns: 1fr;
    }

    .tooltip {
        max-width: 250px;
        font-size: 0.8rem;
    }

    .detail-item,
    .comparison-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* New content mobile styles */
    .intro-section h2 {
        font-size: 2rem;
    }

    .intro-text {
        font-size: 1.1rem;
    }

    .concepts-section h3,
    .game-recommendations h3,
    .usage-guide h3,
    .faq-section h3 {
        font-size: 1.75rem;
    }

    .concept-card {
        padding: 1.5rem;
    }

    .concept-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .concept-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .sensitivity-formats {
        grid-template-columns: 1fr;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-recommendation-card {
        padding: 1.25rem;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .edpi-range {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .reference-card {
        padding: 1.25rem;
    }

    .reference-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .calculator-card,
    .results-card,
    .game-info-card {
        padding: 1rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.4rem;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .calculate-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .result-number {
        font-size: 2rem;
    }

    /* New content small screen styles */
    .intro-section h2 {
        font-size: 1.75rem;
    }

    .intro-text {
        font-size: 1rem;
    }

    .concepts-section h3,
    .game-recommendations h3,
    .usage-guide h3,
    .faq-section h3 {
        font-size: 1.5rem;
    }

    .concept-card {
        padding: 1.25rem;
    }

    .game-recommendation-card {
        padding: 1rem;
    }

    .step {
        padding: 1.25rem;
    }

    .faq-item {
        padding: 1.25rem;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }

    .reference-card {
        padding: 1rem;
    }

    .reference-icon {
        font-size: 1.75rem;
    }

    .formula {
        font-size: 1.25rem;
    }
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    min-height: 1.2em;
}

.contact-form-section .calculate-btn {
    width: auto;
    margin: 2rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form-section .calculate-btn {
        width: 100%;
        margin-top: 1.5rem;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .loading-overlay,
    .tooltip {
        display: none;
    }

    body {
        background: white;
    }

    .calculator-card,
    .results-card,
    .education-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .form-input,
    .form-select {
        border-width: 3px;
    }

    .calculate-btn {
        border: 2px solid #000;
    }

    .tooltip {
        border: 2px solid #fff;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animation for result appearance */
.results-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hover effects for interactive elements */
.education-card:hover .education-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* SEO Enhancement Styles */
.key-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.benefit-item {
    color: #2d3748;
    font-weight: 500;
    font-size: 0.95rem;
}

.popular-searches-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.popular-searches-section h3 {
    color: #1a202c;
    margin-bottom: 1rem;
    text-align: center;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.popular-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform, box-shadow;
}

.popular-item:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popular-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.popular-item p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}