/* ========================
   基本設定
   ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 
                 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, Meiryo, sans-serif !important;
    background-color: #f5f5f5 !important;
    line-height: 1.8 !important;
    color: #333 !important;
}

.container {
    margin: 0 auto;
}

/* ========================
   ヘッダー画像
   ======================== */
/* Header Secondary */
.header-secondary {
    background: #00b5ad;
    border-bottom: 3px solid #00b5ad;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-secondary .logo {
    max-width: 180px;
}

.header-nav a {
    color: #00b5ad;
    border-color: #00b5ad;
    background: #fff;
    transition: all 0.3s ease;
}

.header-nav a:hover,
.header-nav a:focus,
.header-nav a:active {
    background-color: #00b5ad !important;
    color: white;
    border-color: #fff !important;
}

.page-title-section {
  background: linear-gradient(135deg, #00d4cc 0%, #00b5ad 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 15px;
}

.page-subtitle {
  font-size: 1.1rem;
  margin-bottom: 0;
  opacity: 0.9;
}

/* ========================
   メインコンテンツ
   ======================== */
.main-content {
    padding: 40px 30px;
}

.page-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 700;
}

.highlight-text {
    color: #23b7b8;
    font-weight: 600;
}

/* ========================
   シミュレーションボックス
   ======================== */
.simulation-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
}

.form-row {
    margin-bottom: 25px;
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group select {
    width: auto;
    min-width: 80px;
}

.form-row select,
.form-row input[type="number"] {
    padding: 10px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    background: white !important;
    transition: border-color 0.3s !important;
}

.form-row select {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

/* Bootstrapのform-selectスタイルを上書き */
select.form-select,
.form-row select.form-select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    background: white !important;
    background-image: none !important;
}

.input-group select {
    width: auto !important;
    min-width: 80px !important;
    flex: 0 0 auto !important;
}

.input-group input[type="number"] {
    flex: 1 !important;
    max-width: 200px !important;
}

.form-row select:focus,
.form-row input[type="number"]:focus,
select.form-select:focus {
    outline: none !important;
    border-color: #23b7b8 !important;
    box-shadow: none !important;
}

.unit {
    font-weight: 600;
    color: #23b7b8;
    font-size: 1rem;
    min-width: 40px;
}

/* ========================
   注意書きボックス
   ======================== */
.note-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 25px 0;
}

.note-box p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ========================
   試算ボタン
   ======================== */
.btn-simulate {
    width: 100% !important;
    background: #23b7b8 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 15px 30px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
}

.btn-simulate:hover {
    background: #1da5a6 !important;
}

.btn-simulate:active {
    background: #189394 !important;
}

/* ========================
   情報セクション
   ======================== */
.info-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.info-section h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.note-list {
    list-style-position: outside;
    padding-left: 20px;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.8;
}

.note-list li {
    margin-bottom: 10px;
}

/* ========================
   モーダル
   ======================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #23b7b8;
    color: white;
    padding: 20px 25px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.close-btn {
    font-size: 2rem;
    font-weight: 300;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

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

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-note {
    background: #e8f5f5;
    border-left: 4px solid #23b7b8;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #333;
}

.modal-note strong {
    color: #23b7b8;
    font-weight: 700;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.usage-table thead {
    background: #f5f5f5;
}

.usage-table th,
.usage-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.usage-table td:first-child {
    width: 80px;
}

.usage-table td:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-table th {
    font-weight: 600;
    color: #23b7b8;
}

.usage-table tbody tr:hover {
    background: #f9f9f9;
}

.usage-table tbody tr.highlight-row {
    background: #e8f5f5;
}

.usage-table tbody tr.highlight-row td {
    color: #23b7b8;
}

.usage-table tfoot {
    background: #f5f5f5;
    font-weight: 600;
}

.usage-table tfoot td {
    border-bottom: none;
    color: #23b7b8;
}

.usage-table input[type="number"] {
    width: 150px !important;
    padding: 6px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 0.95rem !important;
    text-align: left !important;
    transition: border-color 0.3s !important;
}

.usage-table input[type="number"]:focus {
    outline: none !important;
    border-color: #23b7b8 !important;
    background: #f0fafa !important;
    box-shadow: none !important;
}

.usage-table tbody tr.highlight-row input[type="number"] {
    background: #e8f5f5;
    font-weight: 600;
}

.edit-note {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #1565c0;
}

.usage-table .unit-text {
    margin-left: 8px;
    color: #23b7b8;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-warning {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #856404;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-modal-cancel,
.btn-modal-ok {
    padding: 10px 25px !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

.btn-modal-cancel {
    background: #f5f5f5 !important;
    color: #666 !important;
}

.btn-modal-cancel:hover {
    background: #e0e0e0 !important;
}

.btn-modal-ok {
    background: #23b7b8 !important;
    color: white !important;
}

.btn-modal-ok:hover {
    background: #1da5a6 !important;
}

/* ========================
   レスポンシブ対応
   ======================== */
@media (max-width: 768px) {
    .main-content {
        padding: 30px 20px;
    }

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

    .simulation-box {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-modal-cancel,
    .btn-modal-ok {
        width: 100%;
    }

    .usage-table th,
    .usage-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .input-group {
        flex-wrap: wrap;
    }

    .input-group input[type="number"] {
        max-width: 100%;
    }
}
