/* セクション共通スタイル */
.company-section {
    background: var(--main-5-color);
    padding: 8%;
}

.company-section:first-child {
    border-radius: 100px 100px 0 0;
}

.company-section:last-child {
    background: var(--main-4-color);
}

.company-section-title {
    position: relative;
    display: grid;
    gap: 10px;
    color: var(--text-color);
    margin-bottom: 3rem;
    line-height: 2rem;
}

.company-section-title .ja {
    font-size: 2rem;
    font-weight: 700;
    width: fit-content;
}

.company-section-title .en {
    font-weight: 400;
    font-size: 1.2rem;
    width: fit-content;
}

.company-section-title .introduction {
    position: absolute;
    top: 0;
    right: 30px;
    height: 160px;
    width: 160px;
    display: none;
}

/* 会社情報グリッドレイアウト */
.company-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* 各情報カード */
.company-data-item {
    padding: 1rem;
    background: var(--text-white-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    /* カード全体を正方形にする */
}

.company-data-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* カード内コンテンツ */
.company-data-content {
    text-align: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* 正方形にする */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* アイコン画像 */
.company-data-icon {
    width: 100%;
    max-width: 200px;
    max-height: 200px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    /* アイコンサイズを固定 */
}

.company-data-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 会社概要テーブルスタイル */
.company-info-table {
    position: relative;
    margin-top: 30px;
    background: var(--text-white-color);
}

.company-details {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.company-details th {
    background: var(--main-gradient);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.company-details td {
    padding: 15px 20px;
    color: var(--text-color);
    border-bottom: 1px solid #eee;
    line-height: 1.6;
    vertical-align: middle;
}

.company-details tr:last-child th,
.company-details tr:last-child td {
    border-bottom: none;
}

/* テーブルのホバー効果 */
.company-details tr {
    transition: background-color 0.2s ease;
}

.company-details tr:hover td {
    background-color: #f8f9fa;
}

/* メインタイトル */
.company-data-title {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

/* メイン数値/テキスト */
.company-data-value {
    color: var(--main-color);
    margin-bottom: 5px;
    line-height: 1.2;
}

/* 数値部分のスタイル（大きなフォントサイズ） */
.company-data-value .value-number {
    font-size: 2.8rem;
    display: inline-block;
    /* カウントアップ時のスムーズな変化のため */
    transition: all 0.3s ease;
}

/* カウントアップアニメーション用のスタイル */
.value-number[data-animated] {
    /* アニメーション中の強調効果 */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* 単位部分のスタイル（小さなフォントサイズ） */
.company-data-value .value-unit {
    font-size: 1.1rem;
    margin-left: 2px;
    font-weight: 400;
}

/* 完全にテキストの場合のスタイル */
.company-data-value .value-text {
    font-size: 1.2rem;
    line-height: 1.3;
}

/* 数値の場合のスタイル（大きなフォントサイズ） */
.company-data-value.numeric {
    font-size: 1.8rem;
}

/* 文字列の場合のスタイル（小さなフォントサイズ） */
.company-data-value.text {
    font-size: 1.2rem;
    line-height: 1.3;
}

/* サブテキスト */
.company-data-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* 詳細ボタンのスタイル */
.details {
    position: absolute;
    right: 70px;
    bottom: 15px;
    padding: 0 5px;
    width: 70px;
    height: 30px;
    line-height: 50px;
    text-align: center;
    color: #FFF;
    font-size: 14px;
    font-weight: bold;
    background: #ff8e9d;
    border-radius: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* 右矢印アイコン */
.details::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -20px;
    margin-top: -10px;
    border: 10px solid transparent;
    border-left: 26px solid #ff8e9d;
    z-index: 0;
}

/* プラスボタン */
.company-data-plus {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--main-3-color);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.company-data-plus:hover {
    background: var(--main-dark-color, #2c5aa0);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


/* ポップアップ用のクラス */
.company-data-item[data-popup] {
    cursor: pointer;
}

/* アニメーション用クラス */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-data-item {
    animation: fadeInUp 0.6s ease forwards;
}

/* 各アイテムを時間差でアニメーション */
.company-data-item:nth-child(1) {
    animation-delay: 0.1s;
}

.company-data-item:nth-child(2) {
    animation-delay: 0.2s;
}

.company-data-item:nth-child(3) {
    animation-delay: 0.3s;
}

.company-data-item:nth-child(4) {
    animation-delay: 0.4s;
}

.company-data-item:nth-child(5) {
    animation-delay: 0.5s;
}

.company-data-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* タブレット用レスポンシブ調整 */
@media (max-width: 1024px) {
    .company-details th {
        width: 150px;
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .company-details td {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .company-data-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .company-data-value .value-number {
        font-size: 1.6rem;
    }

    .company-data-value .value-unit {
        font-size: 1rem;
    }

    .company-data-value .value-text {
        font-size: 1.1rem;
    }

    .company-data-value.numeric {
        font-size: 1.6rem;
    }

    .company-data-value.text {
        font-size: 1.1rem;
    }
}

/* スマホ用レスポンシブ調整 */
@media (max-width: 768px) {
    .company-section-title .ja {
        font-size: 1.5rem;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .break-here::after {
        content: "\A";
        /* 改行 */
        white-space: pre;
    }


    .company-page .container {
        padding: 30px 15px;
    }

    .company-section-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .company-data-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .company-data-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }

    .company-data-title {
        font-size: 1rem;
    }

    .company-data-value .value-number {
        font-size: 1.5rem;
    }

    .company-data-value .value-unit {
        font-size: 0.9rem;
    }

    .company-data-value .value-text {
        font-size: 1rem;
    }

    .company-data-value.numeric {
        font-size: 1.5rem;
    }

    .company-data-value.text {
        font-size: 1rem;
    }

    .company-data-description {
        font-size: 0.85rem;
    }

    .company-section-title .introduction {
        position: absolute;
        top: 70px;
        right: -5px;
        height: 90px;
        width: 90px;
    }

    /* 会社概要テーブルのスマホ対応 */
    .company-info-table {
        margin-top: 20px;
    }

    .company-details {
        font-size: 0.9rem;
    }

    /* スマホでは縦スタック表示に変更 */
    .company-details tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #eee;
        overflow: hidden;
    }

    .company-details th,
    .company-details td {
        display: block;
        width: -webkit-fill-available;
        border: none;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .company-details th {
        background: var(--main-color);
        color: white;
        font-size: 0.85rem;
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .company-details td {
        background: white;
        border-bottom: none;
    }

    .popup-inner {
        width: 70%;
        margin: 25% auto;
    }

    .popup-inner .close-popup {
        position: fixed;
        bottom: 5%;
        top: auto;
        right: 42%;
        width: 50px;
        height: 50px;
        z-index: 1001;
    }

    .popup h2 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }

    .popup-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .popup-image {
        margin-bottom: 15px;
    }
}

/* ロード時のスケルトンアニメーション（将来的な拡張用） */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.company-data-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}

.licenseNumbersBox {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

/* ポップアップスタイル（page-home.cssから継承） */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(5px);
    /* Safari対応 */
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-inner {
    background: white;
    padding: 2rem;
    overflow: hidden;
    overflow-y: auto;
    max-width: 850px;
    max-height: 430px;
    width: 90%;
    margin: 5% auto;
    position: relative;
    border: 2px solid #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: scaleIn 0.3s ease-in-out;
}

.popup h2 {
    color: var(--main-color);
    font-weight: 600;
    font-size: 2rem;
    line-height: 140%;
    text-align: center;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

.popup-content {
    padding: 3% 5%;
    background: var(--popup-back-color);
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--main-gradient);
    box-shadow: var(--shadow);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.close-popup:hover {
    transform: scale(1.2);
}

.close-popup svg {
    width: 100%;
    height: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ポップアップの追加スタイル（page-home.cssのスタイルを継承） */
.popup-image {
    text-align: center;
    margin-bottom: 20px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto 20px auto;
}

.popup-image img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.popup-text {
    line-height: 1.7;
    color: #333;
}

.popup-text h3 {
    color: var(--main-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.popup-text p {
    margin-bottom: 15px;
}

.popup-text ul, .popup-text ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.popup-text li {
    margin-bottom: 5px;
}

/* スマホでのポップアップテキスト調整 */
@media (max-width: 768px) {
    .popup-inner {
        width: 70%;
        margin: 25% auto;
        padding: 1rem;
    }

    .popup-inner .close-popup {
        position: fixed;
        bottom: 5%;
        top: auto;
        right: 42%;
        width: 50px;
        height: 50px;
        z-index: 1001;
    }

    .popup h2 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }

    .popup-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .popup-image {
        margin-bottom: 15px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8rem;
    background-color: #fff;
    border: 1px solid #ccc;
}

thead {
    background-color: #f0f0f0;
}

th, td {
    border: 1px solid #ccc;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

th {
    font-weight: bold;
    background-color: #e0e0e0;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:hover {
    background-color: #f5faff;
}

@media (max-width: 768px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {}

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 1rem;
    }

    td {
        position: relative;
        border: 1px solid #ddd;
    }

    td::before {
        position: absolute;
        top: 12px;
        left: 16px;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #555;
    }
}