:root {
    --primary: #0284c7;
    /* Sky Blue */
    --primary-hover: #0369a1;
    --secondary: #64748b;
    /* Slate */
    --bg-body: #f8fafc;
    /* Very light cool gray */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #475569;
    /* Slate 600 - Darker for better contrast */
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Layout */
.container {
    max-width: 1307px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Header */
header {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    align-items: center;
}

nav a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

nav a:hover,
nav a.active {
    color: var(--primary);
    background: #f1f5f9;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 2rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    margin: 2rem 0 3rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

/* Team Text */
.team-content {
    background: white;
    padding: 3rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: auto;
    /* Push to bottom */
    text-align: center;
    color: var(--text-muted);
    background: white;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0284c7;
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #dcfce7;
}

/* Centered View Helper */
.view-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contain-anim {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Append New Styles */
.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    background: #f8fafc;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--primary);
}

.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 90;
}

.scroll-top:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

body.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --glass: rgba(15, 23, 42, 0.9);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

/* Web App Utilities */
.app-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.app-btn {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: var(--transition);
}

.app-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(2, 132, 199, 0.2);
}

.app-input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.app-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.result-area {
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-main);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Tablet Styles (768px and below) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .logo img {
        height: 35px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 100;
        padding: 5rem 2rem 2rem;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    nav a {
        display: block;
        padding: 1rem;
        font-size: 1rem;
    }

    .hero {
        padding: 3rem 1.5rem;
        margin: 1rem 0 2rem;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    input, textarea, select {
        font-size: 16px;
    }

    .webapp-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .webapp-title {
        font-size: 1.5rem;
    }

    .app-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .team-content {
        padding: 2rem 1.5rem;
    }

    footer {
        padding: 2rem 0;
        font-size: 0.9rem;
    }
}

/* Mobile Styles (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo img {
        height: 30px;
    }

    .hero {
        padding: 2rem 1rem;
        border-radius: 16px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .webapp-container {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .webapp-title {
        font-size: 1.35rem;
        gap: 0.5rem;
    }

    .webapp-section {
        margin-bottom: 1.5rem;
    }

    .result-area {
        padding: 1.25rem;
    }

    th, td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }

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

    .form-group label {
        font-size: 0.9rem;
    }

    nav {
        width: 100%;
        right: -100%;
    }

    nav.active {
        right: 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .app-btn, nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn:hover, .app-btn:hover, nav a:hover {
        transform: none;
    }

    .btn:active, .app-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    input[type='checkbox'],
    input[type='radio'] {
        min-width: 20px;
        min-height: 20px;
    }

    nav li {
        margin: 0.25rem 0;
    }
}
