/*
 * UI/UX Enhancements for Japanese Calculator Site (keisan.co.in)
 * Theme: Precision & Trust - Clean, professional, and data-focused design.
 * Updated: 4-column grid layout for calculators
 */

/* --- Global Reset and Typography --- */
:root {
    --color-primary: #0056b3; /* Deep Blue for professionalism */
    --color-accent: #00a896; /* Muted Teal for CTAs and highlights */
    --color-background: #f8f9fa; /* Light off-white for main background */
    --color-card-bg: #ffffff;
    --color-text-dark: #212529;
    --color-text-light: #6c757d;
    --font-family-base: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
    --border-radius-base: 8px;
    --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-background);
    color: var(--color-text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Hero Section (modern-hero) --- */
.modern-hero {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--color-background) 0%, #e9ecef 100%);
    text-align: center;
    overflow: hidden;
}

.hero-content-wrapper {
    position: relative;
    z-index: 1;
}

.hero-badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    margin-bottom: 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: rgba(0, 86, 179, 0.1);
    border: 1px solid rgba(0, 86, 179, 0.2);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    margin-right: 8px;
}

.hero-title-modern {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.gradient-modern {
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.hero-desc-modern {
    font-size: 1.15rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

/* --- Buttons (btn-modern) --- */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: var(--border-radius-base);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary-modern {
    background: var(--color-primary);
    color: white;
}

.btn-primary-modern:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: var(--shadow-subtle);
}

.btn-secondary-modern {
    background: transparent;
    color: var(--color-text-dark);
    border-color: var(--color-text-light);
}

.btn-secondary-modern:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-modern svg {
    margin-left: 8px;
}

/* --- Hero Stats (hero-stats-modern) --- */
.hero-stats-modern {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.stat-modern {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: #dee2e6;
    align-self: center;
}

/* --- Calculator Grid (calculators-modern) - 4 COLUMNS --- */
.calculators-modern {
    padding: 60px 0;
}

.section-header-modern {
    text-align: center;
    margin-bottom: 40px;
}

.section-title-modern {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-subtitle-modern {
    color: var(--color-text-light);
}

.calculator-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
}

.calc-card-modern {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-subtle);
    text-decoration: none;
    color: var(--color-text-dark);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    z-index: 1;
}

.calc-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
    z-index: 10;
}

.calc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calc-icon-modern {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}

.calc-icon-modern svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.calc-icon-purple { background-color: #6f42c1; }
.calc-icon-blue { background-color: #007bff; }
.calc-icon-green { background-color: #28a745; }
.calc-icon-pink { background-color: #e83e8c; }
.calc-icon-orange { background-color: #fd7e14; }
.calc-icon-gray { background-color: #6c757d; }
.calc-icon-teal { background-color: #00a896; }
.calc-icon-indigo { background-color: #6610f2; }
.calc-icon-red { background-color: #dc3545; }
.calc-icon-brown { background-color: #8b6f47; }
.calc-icon-cyan { background-color: #17a2b8; }
.calc-icon-lime { background-color: #82c91e; }

.calc-badge {
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    background-color: var(--color-accent);
}

.calc-badge-sale {
    background-color: #dc3545;
}

.calc-badge-new {
    background-color: #28a745;
}

.calc-title-modern {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.calc-desc-modern {
    font-size: 0.85rem;
    color: var(--color-text-light);
    flex-grow: 1;
    margin-bottom: 12px;
}

.calc-footer-modern {
    display: flex;
    align-items: center;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.calc-card-modern:hover .calc-footer-modern {
    color: var(--color-accent);
}

.calc-footer-modern svg {
    margin-left: 5px;
    transition: transform 0.3s ease;
    width: 14px;
    height: 14px;
}

.calc-card-modern:hover .calc-footer-modern svg {
    transform: translateX(5px);
}

.calc-card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.coming-soon-text {
    color: var(--color-text-light);
}

/* --- Features Section (features-modern) --- */
.features-modern {
    padding: 60px 0;
    background-color: var(--color-card-bg);
}

.features-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item-modern {
    padding: 20px;
    border-radius: var(--border-radius-base);
}

.feature-icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 86, 179, 0.1);
    border-radius: 50%;
    color: var(--color-primary);
}

.feature-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.feature-title-modern {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-desc-modern {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* --- Simple Calculator Widget --- */
.simple-calculator-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.simple-calculator-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.calculator-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--color-primary);
}

.calculator-display {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 20px;
    border-radius: 8px;
    text-align: right;
    margin-bottom: 20px;
    min-height: 60px;
    word-wrap: break-word;
    word-break: break-all;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family-base);
}

.calc-btn-number {
    background-color: #f0f0f0;
    color: var(--color-text-dark);
    border: 1px solid #e0e0e0;
}

.calc-btn-number:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.calc-btn-operator {
    background-color: var(--color-primary);
    color: white;
}

.calc-btn-operator:hover {
    background-color: #004494;
    transform: translateY(-2px);
}

.calc-btn-equals {
    background-color: var(--color-accent);
    color: white;
    grid-column: span 2;
}

.calc-btn-equals:hover {
    background-color: #00917f;
    transform: translateY(-2px);
}

.calc-btn-clear {
    background-color: #dc3545;
    color: white;
    grid-column: span 2;
}

.calc-btn-clear:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

/* --- SEO Content Section (content-modern) --- */
.content-modern {
    padding: 60px 0;
}

.content-inner-modern {
    max-width: 800px;
    margin: 0 auto;
}

.content-inner-modern h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 4px solid var(--color-accent);
    padding-left: 15px;
}

.content-inner-modern h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 10px;
}

.content-inner-modern p {
    margin-bottom: 15px;
    color: var(--color-text-dark);
}

/* --- FAQ Section (faq-modern) --- */
.faq-modern {
    margin-top: 20px;
}

.faq-item-modern {
    background-color: var(--color-card-bg);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-base);
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item-modern summary {
    display: block;
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    position: relative;
    transition: background-color 0.2s;
}

.faq-item-modern summary:hover {
    background-color: #f1f3f5;
}

.faq-item-modern summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.faq-item-modern[open] summary::after {
    content: '−';
}

.faq-item-modern p {
    padding: 0 20px 15px;
    margin-top: 0;
    color: var(--color-text-light);
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 1200px) {
    .calculator-grid-modern {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .modern-hero {
        padding: 60px 0;
    }
    .hero-title-modern {
        font-size: 2.2rem;
    }
    .hero-cta-group {
        flex-direction: column;
        gap: 10px;
    }
    .hero-stats-modern {
        flex-wrap: wrap;
        gap: 20px;
    }
    .stat-divider {
        display: none;
    }
    .calculator-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    .simple-calculator-wrapper {
        padding: 20px;
    }
    .calculator-display {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .calculator-grid-modern {
        grid-template-columns: 1fr;
    }
    .calculator-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    .calc-btn-equals,
    .calc-btn-clear {
        grid-column: span 1;
    }
}
