/*---------------------------------------
  Site-wide Variables & Reset
---------------------------------------*/
:root {
  --primary-color: #2c3e50;
  --accent-color:  #0078d4;
  --bg-color:      #ecf0f1;
  --text-color:    #333333;
  --nav-height:    60px;
  --max-width:     1200px;
  --gap:           1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 10px;
  min-height: 100vh
}
@media (min-height: 100vh) {
  /* 横幅がmin-widthで指定した値以上の時に適用 */
  body {
    height: 100%;
  }
}
/*---------------------------------------
   リンクに関するcss Links & Typography
---------------------------------------*/
a {
  /* color: var(--primary-color); */
  color: #ffffff; /*見やすくするためにヘッダーのリンクは白 */
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-color);
}

/*---------------------------------------
  Header & Nav
---------------------------------------*/
header {
  /*height: var(--nav-height);*/
  background-color: var(--primary-color); 
  display: flex;
  align-items: center;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: var(--gap);
}

nav a {
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/*---------------------------------------
  Main Container & Footer
---------------------------------------*/
main {
  /*max-width: var(--max-width);*/
  margin: var(--gap) auto;
  padding: 0 var(--gap);
  display: flex;
  flex-direction: row;
  min-height: 100vh
}

footer {
  text-align: center;
  padding: var(--gap) 0;
  font-size: 0.9rem;
  color: #777777;
}

/*---------------------------------------
  Buttons
---------------------------------------*/
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn:hover {
  background-color: #005fa3;
  color: #fff;
}

/*---------------------------------------
  Card Grid (for listing cards)
---------------------------------------*/
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.card {
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}

.card-body {
  padding: var(--gap);
  flex: 1;
}

.card-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/*---------------------------------------
  Forms & Inputs
---------------------------------------*/
.form-group {
  margin-bottom: var(--gap);
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cccccc;
  border-radius: 4px;
}

/*---------------------------------------
  Tables
---------------------------------------*/
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
}

.table th,
.table td {
  padding: 0.5rem;
  border: 1px solid #dddddd;
  text-align: left;
}

.details-searchfrom{
  user-select: none;
  -webkit-user-select: 
  none;-ms-user-select: 
  none;-moz-user-select: none;
  margin-bottom: 0.5ex; 
  border: 2px solid #c2c2c2; 
  border-radius: 5px;
}
.summary-searchfrom{
  padding: 10px 15px; 
  cursor: pointer; 
  position: relative; 
  display: flex; 
  align-items: center;
}

/*---------------------------------------
  Responsive Adjustments
---------------------------------------*/
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/*--------------------------------------
  Main Content
--------------------------------------*/
.main-content {
  /*display: flex;*/
  flex-flow: column;
  justify-content: space-evenly;
  box-sizing: border-box;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 100%;
  padding: 10px;
  margin-left: 10px;
}

/*--------------------------------------
  Grey out disabled buttons
--------------------------------------*/
button[disabled],
.disabled-btn {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}
/* Prevent Bootstrap hover colors on disabled buttons/links */
button[disabled]:hover,
.disabled-btn:hover {
  background-color: #ccc;
  color: #666;
}

/*--------------------------------------
  Pagination UI
--------------------------------------*/
.pagination a,
.pagination span {
  margin: 0 3px;        /* horizontal spacing */
  padding: 2px 1px;     /* clickable area */
  text-decoration: none;
}

.pagination a {
  color: black;         /* normal links */
}

.pagination a:hover {
  background-color: #f0f0f0;
  border-radius: 3px;
}

.pagination .current {
  color: #007bff;       /* bright blue */
  font-weight: bold;
}

/* deal with longtext */
.long-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  white-space: normal; /* allow wrapping */
  line-height: 1.2;
  max-height: 3.6em; /* ~3 lines */
}

/* Applies to fallback cards, image cards, lineup cards */
.card-fallback,
.deck-card-image,
.deck-card-lineup-image,
.card-preview-thumb {
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere; /* 長い文字列を行で分ける Separates long strings only when needed */
  white-space: normal;
  line-height: 1.2;
}

/* Applies to search results and deck builder desktop */
.card-item{
  overflow-wrap: anywhere; /* 長い文字列を行で分ける Separates long strings only when needed */
}
.card-item-prmlis {
  overflow-wrap: anywhere; /* 長い文字列を行で分ける Separates long strings only when needed */
}

/* Applies to card_info pages and detail views */
.card-details,
.card-info-text,
.card-info-table td {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  overflow-wrap: anywhere; /* 長い文字列を行で分ける Separates long strings only when needed */
}