/* 基本レイアウト */
.license-manager-container {
    max-width: 98%;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 検索フォーム */
.search-controls {
    background: #f6f7f7;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1d2327;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    align-self: end;
}

.button-primary {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.button-reset {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #dcdcde;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

/* テーブルコンテナ */
.license-data-container {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.scrollable-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    max-height: 70vh;
    position: relative;
}

/* テーブルスタイル */
.license-data-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.license-data-table th, 
.license-data-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #dcdcde;
    text-align: left;
    vertical-align: middle;
}

.license-data-table th {
    background-color: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
    position: sticky;
    top: 0;
    z-index: 10;
}

.license-data-table th.sortable a {
    color: #2271b1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.license-data-table th.sorted a {
    color: #135e96;
}

.sort-indicator {
    font-size: 0.8em;
}

/* 行の状態スタイル */
.license-data-table tr.active {
    background-color: #f0fff0;
}

.license-data-table tr.expiring-soon {
    background-color: #fff3cd;
}

.license-data-table tr.expired {
    background-color: #ffeeee;
}

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.expired {
    background-color: #f8d7da;
    color: #721c24;
}

/* テーブル情報表示 */
.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
}

.result-count {
    font-weight: 600;
    color: #1d2327;
}

.table-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 2px;
}

.legend-color.active {
    background-color: #f0fff0;
    border: 1px solid #d4edda;
}

.legend-color.expiring-soon {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

.legend-color.expired {
    background-color: #ffeeee;
    border: 1px solid #f8d7da;
}

/* レスポンシブ対応 */
@media screen and (max-width: 782px) {
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .scrollable-table-wrapper {
        max-height: 60vh;
    }
    
    .license-data-table {
        font-size: 0.8rem;
    }
    
    .license-data-table th, 
    .license-data-table td {
        padding: 0.5rem;
    }
}

/* 印刷用スタイル */
@media print {
    .search-controls, .form-actions {
        display: none;
    }
    
    .scrollable-table-wrapper {
        overflow: visible;
        max-height: none;
    }
    
    .license-data-table {
        min-width: 100%;
    }
}

/* 追加css */
/* テーブルスタイル */
.license-data-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto; /* 追加: コンテンツに基づいて列幅を調整 */
}

.license-data-table th, 
.license-data-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #dcdcde;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap; /* 追加: テキストを折り返さない */
}

.license-data-table th {
    background-color: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 100px; /* 追加: 最小幅を設定 */
}

/* 特定の長いカラム名に合わせて調整 */
.license-data-table th[data-column="Product Selection"] {
    min-width: 150px;
}

.license-data-table th[data-column="License Serial Nb"] {
    min-width: 150px;
}

.license-data-table th[data-column="Expiration Date"] {
    min-width: 120px;
}

.license-data-table th[data-column="Activation date"] {
    min-width: 120px;
}

/* ソート可能なヘッダーのリンクスタイル調整 */
.license-data-table th.sortable a {
    color: #2271b1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 100%; /* 追加: リンク要素を親いっぱいに広げる */
}

/* モバイル表示時の調整 */
@media screen and (max-width: 782px) {
    .license-data-table th, 
    .license-data-table td {
        white-space: normal; /* モバイルでは折り返しを許可 */
        padding: 0.5rem;
    }
    
    .license-data-table th {
        min-width: 80px; /* モバイル用に最小幅を縮小 */
    }
}