/* ==========================================================================
   OFFICIAL IOI STATISTICS STYLESHEET CLONE (stats.ioinformatics.org)
   Tailored for BdOIDS (Bangladesh Olympiad in Informatics Practice Series)
   ========================================================================== */

body {
  margin: 0px;
  padding: 0px;
  border: 0px;
  background-color: #F2F2F2;
  font-family: 'Tahoma', 'Geneva', sans-serif;
  font-size: 14px;
  color: #000000;
  line-height: 1.4;
}

img {
  border: none;
  vertical-align: middle;
}

.mainpage {
  max-width: 1060px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;
  margin-bottom: 20px;
  background-color: #E2E2E2;
  box-shadow: 0px 0px 10px 7px #E2E2E2;
  border-radius: 15px;
  overflow: hidden;
}

.mainimage {
  margin-right: 2px;
  margin-bottom: 8px;
  border-bottom-right-radius: 15px;
  border-bottom-left-radius: 15px;
  border-top-left-radius: 15px;
  padding: 4px;
  float: left;
  background-color: white;
  width: 159px;
  height: 90px;
  object-fit: contain;
}

.mainheader {
  font-size: 24px;
  text-align: center;
  margin-bottom: 2px;
  margin-left: 162px;
  border-bottom-right-radius: 15px;
  border-top-right-radius: 15px;
  font-family: 'Electrolize', sans-serif;
  padding-top: 26px;
  padding-bottom: 26px;
  background-color: white;
  color: black;
  letter-spacing: -0.5px;
}

.mainmenu a, .secmenu a, .countrymenu a {
  font-family: 'Electrolize', sans-serif;
  font-size: 16px;
  padding-left: 10px;
  padding-right: 10px;
  vertical-align: middle;
  padding-top: 5px;
  padding-bottom: 5px;
  display: inline-block;
  text-decoration: none;
}

.mainmenu a {
  float: left;
}

.secmenu a {
  float: right;
}

.secmenu a:first-child {
  border-bottom-right-radius: 15px;
  margin-right: 15px;
  padding-right: 12px;
}

.mainmenu a:last-child, .countrymenu a:first-child {
  border-bottom-right-radius: 15px;
  padding-left: 10px;
  padding-right: 12px;
}

.olympdata .countrymenu a:last-child, .secmenu a:last-child {
  border-bottom-left-radius: 15px;
  padding-left: 12px;
}

.mainmenu a:link, .mainmenu a:visited, .secmenu a:link, .secmenu a:visited, 
.countrymenu a:link, .countrymenu a:visited, a:link .mainheader, a:visited .mainheader {
  color: black;
  background-color: white;
}

.mainmenu a:hover, .secmenu a:hover, .countrymenu a:hover, a:hover .mainheader {
  background-color: #E2E2E2;
  color: black;
  text-decoration: none;
}

.mainmenu a.selected, .secmenu a.selected, .countrymenu a.selected {
  background-color: #E2E2E2;
  font-weight: bold;
}

.countrymenu a {
  display: block;
  float: right;
  height: 26px;
  line-height: 26px;
}

.countryname a, .countryname div {
  display: block;
  height: 46px;
  float: left;
  padding-right: 6px;
  padding-left: 6px;
}

.countryname a:first-child, .countryname div:first-child {
  padding-left: 10px;
}

.olympdata .countryname a:first-child, .olympdata .countryname div:first-child {
  padding-left: 12px;
  border-top-left-radius: 15px;
}

.countryname a:last-child, .countryname div:last-child {
  padding-right: 12px;
  border-top-right-radius: 15px;
}

.maincontent {
  background-color: white;
  border-radius: 15px;
  padding: 14px 16px;
  clear: both;
  font-family: 'Tahoma', 'Geneva', sans-serif;
  font-size: 14px;
  margin-bottom: 8px;
  min-height: 380px;
  box-sizing: border-box;
}

.maincontent p {
  margin-top: 0;
  margin-bottom: 12px;
}

.basicname {
  font-size: 26px;
  clear: both;
  background-color: white;
  float: left;
  padding-left: 14px;
  padding-right: 14px;
  padding-top: 4px;
  padding-bottom: 4px;
  border-top-right-radius: 15px;
  border-top-left-radius: 15px;
  font-family: 'Tahoma', 'Geneva', sans-serif;
  font-weight: bold;
}

.nocorner {
  border-top-left-radius: 0px;
}

.countryinfo {
  background-color: #E2E2E2;
  font-family: 'Electrolize', sans-serif;
  clear: both;
  margin-bottom: 8px;
  min-height: 80px;
}

.countryflag {
  float: left;
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  margin-right: 2px;
  margin-bottom: 8px;
  height: 80px;
  width: 133px;
  display: block;
}

.countryinfo .countrydata {
  display: block;
  float: right;
  width: calc(100% - 135px);
}

.countryname {
  font-size: 28px;
  display: block;
  background-color: white;
  margin-bottom: 2px;
  border-top-right-radius: 15px;
  height: 46px;
  line-height: 46px;
}

.olympdata .countryname {
  border-top-left-radius: 15px;
}

.countrydata {
  display: inline-block;
  width: 100%;
}

.olympdata {
  width: 100% !important;
}

.countrymenu {
  font-size: 16px;
  height: 32px;
  background-color: white;
  border-bottom-right-radius: 15px;
}

.olympdata .countrymenu {
  border-bottom-left-radius: 15px;
}

/* IOI Delegation Layout (.delcontent, .delegationmember) */
.delcontent {
  background-color: white;
  border-radius: 15px;
  padding: 10px;
  clear: both;
  font-family: 'Tahoma', 'Geneva', sans-serif;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  box-sizing: border-box;
}

.mainpage .delcontent:last-child {
  margin-bottom: 0px;
}

.delcontent a:link, .delcontent a:visited {
  color: black;
}

.delegationmember {
  width: calc(50% - 5px);
  min-width: 320px;
  height: 180px;
  border: 1px solid #AAAAAA;
  display: inline-block;
  background-color: white;
  text-decoration: none;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  transition: background-color 0.15s ease;
}

.delegationmember:hover {
  background-color: #E2E2E2;
}

.delegationmember .member-photo {
  float: left;
  width: 135px;
  height: 180px;
  border-right: 1px solid #AAAAAA;
  background: #F4F6F9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.delegationmember .member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delegationmember .name {
  padding-top: 8px;
  padding-right: 14px;
  padding-left: 10px;
  margin-bottom: 2px;
  font-size: 24px;
  font-weight: bold;
  font-family: 'Electrolize', sans-serif;
  text-align: right;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delegationmember .handle-tag {
  padding-right: 14px;
  font-size: 13px;
  color: #666;
  text-align: right;
  margin-bottom: 4px;
}

.delegationmember .participation {
  padding-right: 14px;
  font-size: 15px;
  color: #333;
  text-align: right;
  font-family: 'Tahoma', 'Geneva', sans-serif;
}

.delegationmember .medal {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 136px;
  height: 40px;
  line-height: 40px;
  text-align: right;
  padding-right: 14px;
  font-weight: bold;
  font-size: 19px;
  font-family: 'Electrolize', sans-serif;
}

.delegationmember .medal.gold {
  background-color: #FFEE55;
  color: #4D3D00;
}

.delegationmember .medal.silver {
  background-color: #CCCCCC;
  color: #222222;
}

.delegationmember .medal.bronze {
  background-color: #B87838;
  color: #FFFFFF;
}

.delegationmember .medal.unofficial {
  background-color: #E8EEF5;
  color: #0F3678;
  font-size: 14px;
}

/* Contestant Profile Layout (Exact IOI style) */
.participantinfo {
  background-color: #E2E2E2;
  font-family: 'Tahoma', 'Geneva', sans-serif;
  clear: both;
  display: flex;
  margin-bottom: 8px;
}

.participantflag {
  float: left;
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  margin-right: 2px;
  margin-bottom: 8px;
  background-color: white;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  color: #1C4B27;
  font-family: 'Electrolize', sans-serif;
  border: 1px solid #CCCCCC;
}

.participantdata {
  flex: 1;
  margin-bottom: 8px;
}

.participantname {
  font-size: 26px;
  background-color: white;
  margin-bottom: 2px;
  border-top-right-radius: 15px;
  padding: 10px 14px;
  text-align: right;
  font-weight: bold;
}

.alternatename {
  padding-top: 2px;
  font-size: 14px;
  font-weight: normal;
  color: #555555;
  text-align: right;
}

.participantmedals {
  background-color: white;
  display: flex;
  border-bottom-right-radius: 15px;
  height: 90px;
}

.participantmedals div {
  flex: 1;
  text-align: center;
  font-size: 42px;
  font-weight: bold;
  height: 90px;
  line-height: 90px;
  font-family: 'Electrolize', sans-serif;
}

/* Medal Backgrounds (Exact IOI hex codes) */
td.gold, tr.gold, .participantmedals .goldcount, .gold {
  background-color: #FFEE55 !important;
  color: #000000 !important;
}

td.silver, tr.silver, .participantmedals .silvercount, .silver {
  background-color: #CCCCCC !important;
  color: #000000 !important;
}

td.bronze, tr.bronze, .participantmedals .bronzecount, .bronze {
  background-color: #B87838 !important;
  color: #FFFFFF !important;
}
td.bronze a, tr.bronze a {
  color: #FFFFFF !important;
}

td.hm, tr.hm, .hm {
  background-color: #B197FA !important;
  color: #000000 !important;
}

td.dq, tr.dq, .dq {
  background-color: #FFA0A0 !important;
  color: #880000 !important;
}

td.unoff, tr.unoff, .unoff {
  background-color: #F0F4FA !important;
  color: #444444 !important;
}

td.nomedal, tr.nomedal {
  background-color: #E8F4FF;
}

/* IOI Table styling */
table, table tr, table th, table td {
  border-style: solid;
  border-width: 1px;
  border-collapse: collapse;
  border-color: #AAAAAA;
  text-align: center;
  padding: 4px 6px;
}

table {
  border-radius: 15px;
  background-color: white;
  width: 100%;
  font-size: 13.5px;
  margin-top: 6px;
  margin-bottom: 12px;
}

table th {
  background-color: #F8F8F8;
  font-weight: bold;
  padding-top: 6px;
  padding-bottom: 6px;
}

table td.taskscore, table th.taskscore {
  padding-left: 3px;
  padding-right: 3px;
  min-width: 44px;
  font-family: monospace, sans-serif;
}

table td.leftalign {
  text-align: left;
}

.squarecolumn {
  min-width: 17px;
  width: 17px;
}

.data_full {
  background-color: #AAFFAA;
}

.data_contestants {
  background-color: #F9FF75;
}

.data_incomplete {
  background-color: #FFA6A6;
}

a {
  text-decoration: none;
}

a:link, a:visited {
  color: #0F3678;
}

th a:hover, td a:hover, .maincontent a:hover, a:hover {
  color: green;
  text-decoration: underline;
}

.warning {
  margin-top: 10px;
  margin-bottom: 10px;
  background-color: #FFA0A0;
  border-radius: 10px;
  padding: 6px 12px;
  clear: both;
  font-size: 13px;
}

.info-banner {
  background-color: #E8F4FF;
  border: 1px solid #B8D6FF;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
}

h3 {
  font-weight: bold;
  font-size: 16px;
  margin-top: 18px;
  margin-bottom: 8px;
}

ul {
  margin-top: 4px;
  margin-bottom: 12px;
  padding-left: 24px;
}

li {
  margin-bottom: 4px;
}

.search-box {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid #AAAAAA;
  border-radius: 6px;
  margin-bottom: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.sorttriangle {
  display: inline;
  margin-left: 4px;
  font-size: 9px;
  vertical-align: middle;
}

@media (max-width: 800px) {
  body {
    min-width: 100%;
    padding: 0 4px;
  }
  .mainpage {
    width: 100%;
    margin-top: 4px;
  }
  .mainheader {
    font-size: 18px;
    margin-left: 0;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .mainimage {
    float: none;
    margin: 0 auto 4px auto;
    display: block;
  }
  .mainmenu a, .secmenu a {
    font-size: 14px;
    padding: 4px 6px;
  }
  .maincontent {
    overflow-x: auto;
  }
  .countryinfo .countrydata {
    width: 100%;
    float: none;
  }
  .countryflag {
    float: none;
    margin: 0 auto 8px auto;
  }
  .delegationmember {
    width: 100%;
    min-width: 0;
  }
}