
/* 
 * Mobile-specific styles
 * These styles are copied from styles.css and adapted for mobile components
 * that use ViewEncapsulation.ShadowDom to block Bootstrap styles
 */

/*****************************************
html, body
******************************************/

html, body {
  height: 100%;
  font-size: 16px;
  line-height: 1.2;
  color: #111;
  background-color: #f5f5f5;
  padding-right: 0px!important;
  font-family:
    -apple-system, BlinkMacSystemFont,               /* iOS/ macOS のUIフォント */
    "Hiragino Sans", "Hiragino Kaku Gothic ProN",    /* iOS/macOS 日本語ゴシック */
    "Yu Gothic UI", "Yu Gothic",                     /* Windows 日本語ゴシック */
    "Meiryo",                                        /* Windows メイリオ */
    "Noto Sans JP",                                  /* (入っていれば) Noto Sans JP */
    "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

/*****************************************
NSI2 背景色
******************************************/
.nsi2-bg {
  background: #f5f5f5;
}

/*****************************************
NSI2 ロゴ
******************************************/
div.nsi2-logo-lg span {
  color: #8A8A8A;
}

div.nsi2-logo-lg span.ns {
  font-size: 60px;
}

div.nsi2-logo-lg span.i {
  font-size: 108px;
  -webkit-text-stroke: 1px #8A8A8A;
  -webkit-text-fill-color: transparent;
}

div.nsi2-logo-lg span.two {
  font-size: 45px;
  -webkit-text-stroke: 1px #8A8A8A;
  -webkit-text-fill-color: transparent;
  vertical-align: top;
  position: relative;
  top: 11.9px;
}

/*****************************************
Mobile-specific layout styles
******************************************/
.login-mobile-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.login-mobile {
  max-width: 400px;
  width: 100%;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-mobile.localhost {
  border: 3px solid #ffc107;
}

.login-mobile.dev-nsi2 {
  border: 3px solid #17a2b8;
}

.login-mobile.nsi2-smtb {
  border: 3px solid #28a745;
}

.form-control {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
select.form-control {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%23667" stroke-width="2" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
  background-size: 12px 8px;
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

.btn-login {
  width: 100%;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-login:hover {
  background-color: #0056b3;
  border-color: #004085;
}

.login-button-group {
  margin-top: 1.5rem;
}

.error-messages {
  margin-top: 1rem;
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.line {
  height: 1px;
  background-color: #dee2e6;
  margin: 1rem 0;
}

/* Utility classes */
.h-100 {
  height: 100%;
}

.w-100 {
  width: 100%;
}

.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.pb-2 {
  padding-bottom: 0.5rem;
}

.pt-0 {
  padding-top: 0;
}

.hidden {
  display: none;
}

.input-group {
  position: relative;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: stretch;
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
}
/*****************************************
検索条件開閉コンポーネント
******************************************/
details summary {
  list-style: none;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary:focus,
details summary:active {
  outline: none;
}
/*****************************************
リスト表示用カード
******************************************/
.list-card {
  background-color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.list-card:active,
.list-card:focus {
  outline: none;
  background-color: inherit;
}
.list-card.selected {
  background-color: #e0f0ff;
}
.list-card.deleted {
  color: #888;
}
.list-card.deleted::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: rgba(0, 0, 0, 0.2);
}

/*****************************************
Mobile Dialog Styles
******************************************/
.modal-dialog-m {
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
}
.dialog-m {
  background-color: #fff;
  max-height: calc(100% - 50px);
  overflow: auto;
}
.dialog-m-header {
  background-color: rgb(102, 102, 102);
  color:white;
}
.dialog-m-header.error {
  background-color: rgb(255, 87, 75);
  color: black;
}
.dialog-m-header.warn {
  background-color: rgb(251, 191, 36);
  color: black;
}
.dialog-m-header.info {
  background-color: rgb(36, 136, 251);
  color: black;
}
.dialog-m-footer {
  position: sticky;
  bottom: 0;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  z-index: 250;
}
.dialog-m-footer > button.save {
  background: #007bff;
  color: white;
}
/* ダイアログ用の共通スタイル */
.mobile-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mobile-dialog-content {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 28rem;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}


/* 共通フォントなど */
.modal-header,
.modal-body,
.modal-footer {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Meiryo", sans-serif;
}

/* モーダル本体（ng-bootstrap 等で .modal-content が付く想定） */
.modal-content {
  background-color: #fff;
  border-radius: 16px;
  border: none;
  max-width: 320px;
  width: 90vw;
  margin: 0 auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

  max-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ヘッダ */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: rgb(102, 102, 102);
  color: white;
  border-bottom: none;
}

/* タイトル */
.modal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

/* × ボタン */
.modal-header .close {
  margin-left: 8px;
  padding: 4px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
}

.modal-header .close:hover {
  opacity: 1;
}

/* ヘッダの種別ごとの色 */
.modal-header.error {
  background-color: rgb(255, 87, 75);
  color: black;
}

.modal-header.warn {
  background-color: rgb(251, 191, 36);
  color: black;
}

.modal-header.info {
  background-color: rgb(36, 136, 251);
  color: black;
}

/* 本文 */
.modal-body {
  padding: 12px 16px;
  background-color: #ffffff;
  flex: 1;
  overflow-y: auto;
}

/* メッセージ行 */
.modal-body p {
  margin: 0 0 8px;
  padding: 6px 0;
  font-size: 14px;
  color: #333333;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body p:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

/* フッタ（下に張り付いて見えるように） */
.modal-footer {
  padding: 12px 16px 16px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: block;
}

/* 「閉じる」ボタンを1行占有させる */
.modal-footer .btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  border-radius: 12px;
  padding: 10px 0;
  cursor: pointer;
  border: 1px solid transparent;
  background-color: #ffffff;
  color: #111827;
}

/* アウトラインダーク風 */
.btn-outline-dark {
  border-color: #4b5563;
  color: #111827;
  background-color: #ffffff;
}

.btn-outline-dark:hover {
  background-color: #4b5563;
  color: #ffffff;
}
