/**
 * SongDoPartners Homepage Styles
 * K-COL Steel Column Design Platform
 */

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* ==========================================================================
   2. PAGE LAYOUT
   ========================================================================== */

.page-wrapper {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* Top Row - Contains left column and main area */
.top-row {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Bottom Row - Product logos and footer aligned (fixed height) */
.bottom-row {
  display: flex;
  flex-shrink: 0;
  height: 100px;
}

/* ==========================================================================
   3. LEFT COLUMN (Fixed width 360px)
   ========================================================================== */

.left-column {
  width: 360px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #d0d0d0;
  position: relative;
  z-index: 10;
}

/* Logo Section */
.logo-section {
  background: linear-gradient(180deg, #e8e8e8 0%, #c8c8c8 100%);
  padding: 8px 12px;
  border-bottom: 2px solid #999;
}

.logo-container {
  display: flex;
  justify-content: center;
}

.logo-container img {
  height: 68px;
  mix-blend-mode: multiply;
}

.welcome-text {
  text-align: center;
  color: #000;
  font-size: 16px;
  font-weight: bold;
  margin: 6px 0;
}

/* Language Toggle */
.lang-row {
  display: flex;
  margin-bottom: 10px;
}

.lang-btn {
  flex: 1;
  padding: 7px;
  border: 1px solid #666;
  background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
  color: #000;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.lang-btn:not(:last-child) {
  border-right: none;
}

/* Login Form */
.login-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px;
  align-items: center;
}

.login-form .label {
  background: #ffd700;
  color: #000;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
}

.login-form input {
  padding: 6px 8px;
  border: 1px solid #999;
  font-size: 13px;
  background: #fff;
}

.login-form input::placeholder {
  color: #888;
  font-size: 12px;
}

.login-btn {
  grid-column: 3;
  grid-row: 1 / 3;
  background: linear-gradient(180deg, #4a90d9 0%, #2a70b9 100%);
  color: #fff;
  border: 2px solid #1a5090;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1.2;
}

.login-help-text {
  font-size: 11px;
  color: #444;
  text-align: center;
  margin: 6px 0 4px;
}

.help-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-bottom: 2px;
}

.help-btn {
  background: linear-gradient(180deg, #e8e8e8 0%, #c8c8c8 100%);
  border: 1px solid #999;
  padding: 5px 12px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  background: #1a1a3a;
  flex: 1;
}

.nav-item {
  display: block;
  background: linear-gradient(180deg, #1a2050 0%, #101535 100%);
  border-left: 8px solid #ff6600;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding: 0 16px;
  color: #ffcc00;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  text-decoration: none;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item:hover {
  background: linear-gradient(180deg, #252a60 0%, #1a1f45 100%);
}

.nav-item.active {
  background: #000;
  color: #fff;
  font-weight: bold;
}

/* 링크된 nav-item 스타일 */
a.nav-item {
  text-decoration: none;
  color: #fff;
  background: #000;
}

a.nav-item:hover {
  color: #fff;
  background: #222;
}

/* Brochure Grid */
.brochure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #1a1a2a;
  flex-shrink: 0;
  border-left: 8px solid #ff6600;
}

.brochure-btn {
  background: linear-gradient(180deg, #1a1a2a 0%, #0a0a1a 100%);
  border: 1px solid #444;
  padding: 10px 8px;
  color: #ffcc00;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

a.brochure-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

a.brochure-btn:hover {
  color: #fff;
}

.brochure-btn:nth-child(odd) {
  border-right: none;
}

.brochure-btn:hover {
  background: linear-gradient(180deg, #2a2a3a 0%, #1a1a2a 100%);
}

.brochure-btn.yellow {
  background: linear-gradient(180deg, #ffd700 0%, #cc9900 100%);
  color: #000;
  font-weight: bold;
}

/* Product Logos - In bottom row, matches footer height */
.product-logos {
  width: 360px;
  background: #d0d0d0;
  padding: 0;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  border-top: 3px solid #333;
  flex-shrink: 0;
}

.product-logos img {
  width: 25%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-logos img:nth-child(1) {
  transform: scale(1.0) translateX(20px);
  filter: contrast(1.3) saturate(1.5);
}

.product-logos img:nth-child(2) {
  transform: scale(0.75);
  filter: contrast(1.3) saturate(1.5);
}

.product-logos img:nth-child(3) {
  transform: scale(1.15);
  filter: contrast(1.3) saturate(1.5);
}

.product-logos img:nth-child(4) {
  transform: scale(0.85) translateY(5px);
  filter: contrast(1.3) saturate(1.5);
}

/* ==========================================================================
   4. MAIN CONTENT AREA (Right pane - fills remaining space)
   ========================================================================== */

.main-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Background Image - Covers entire right pane */
.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../assets/images/background_vessel_nyc.png') center center no-repeat;
  background-size: cover;
  z-index: 0;
}

/* Content layer - On top of background */
.content-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   5. RIGHT SIDEBAR (Transparent, fits naturally)
   ========================================================================== */

.right-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  padding: 15px;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Exchange Table - Semi-transparent */
.exchange-table {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #666;
  margin-bottom: 15px;
}

.exchange-header {
  background: linear-gradient(180deg, #666 0%, #555 100%);
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
}

.exchange-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #ddd;
}

.exchange-row:last-child {
  border-bottom: none;
}

.exchange-cell {
  padding: 5px 10px;
  font-size: 12px;
  color: #333;
  border-right: 1px solid #ddd;
}

.exchange-cell:last-child {
  border-right: none;
}

.exchange-cell.highlight {
  background: #fffacd;
}

/* News Section - Semi-transparent */
.news-section {
  margin-top: 20px;
}

.news-title {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 4px #000;
  text-align: center;
  margin-bottom: 15px;
}

.news-item {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.5);
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 19px;
  font-style: italic;
  color: #ffd700;
  line-height: 1.5;
  text-align: center;
}

/* ==========================================================================
   6. FOOTER (In bottom row, same height as product-logos)
   ========================================================================== */

.footer {
  flex: 1;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  gap: 12px;
  z-index: 2;
  position: relative;
  border-top: 3px solid #333;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.footer-info {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  color: #ccc;
  line-height: 1.3;
  overflow: hidden;
}

.footer-info div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.footer-info a {
  color: #6af;
  text-decoration: none;
}

.footer-info a:hover {
  text-decoration: underline;
}

/* Database Button */
.db-button {
  background: linear-gradient(180deg, #ffd700 0%, #cc9900 100%);
  border: 2px solid #996600;
  padding: 6px 12px;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
}

.db-button .click-text {
  font-size: 10px;
  color: #333;
}

.db-button .main-text {
  font-size: 12px;
  color: #000;
  font-weight: bold;
}

/* Company Logos - 3 columns × 2 rows grid */
.company-logos {
  display: grid;
  grid-template-columns: repeat(3, 55px);
  grid-template-rows: repeat(2, 38px);
  gap: 3px;
  flex-shrink: 0;
  align-items: center;
}

.company-logo {
  background: #fff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 2px;
  overflow: hidden;
  height: 38px;
  width: 55px;
}

.company-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* All company logos share the same styles - links fill container */
.company-logo a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   7. IMAGE ENHANCEMENTS
   ========================================================================== */

/* K-COL Image - Enhanced contrast */
.kcol-image {
  filter: contrast(1.3) saturate(1.2) brightness(1.05);
}

/* ==========================================================================
   8. WORLD CLOCKS
   ========================================================================== */

.world-clocks {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  gap: 20px;
  z-index: 10;
}

.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5f5f5 0%, #d0d0d0 100%);
  border: 4px solid #8b7355;
  box-shadow: 
    0 0 0 2px #c9a96e,
    inset 0 2px 4px rgba(0,0,0,0.2),
    0 4px 8px rgba(0,0,0,0.3);
  position: relative;
  transition: all 0.5s ease;
}

/* 밤 시간 시계 스타일 (저녁 6시 ~ 아침 6시) */
.clock.night {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-color: #4a4a6a;
  box-shadow: 
    0 0 0 2px #5a5a8a,
    inset 0 2px 4px rgba(0,0,0,0.4),
    0 4px 8px rgba(0,0,0,0.5),
    0 0 15px rgba(100, 149, 237, 0.3);
}

.clock.night .hour-hand,
.clock.night .minute-hand {
  background: #e0e0e0;
}

.clock.night .second-hand {
  background: #ff6b6b;
}

.clock.night .clock-center {
  background: #ff6b6b;
  box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

.clock-face {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: 50% 100%;
  z-index: 5;
}

.hour-hand {
  width: 4px;
  height: 18px;
  background: #222;
  margin-left: -2px;
  border-radius: 2px;
}

.minute-hand {
  width: 3px;
  height: 24px;
  background: #222;
  margin-left: -1.5px;
  border-radius: 2px;
}

.second-hand {
  width: 2px;
  height: 28px;
  background: #e74c3c;
  margin-left: -1px;
  z-index: 6;
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* AM/PM 표시 (도시명과 함께) */
.ampm-indicator {
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 1px;
  margin-left: 3px;
}

.clock-label {
  margin-top: 5px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN - MOBILE & TABLET
   ========================================================================== */

/* Footer overflow fixes are now in main footer styles */

/* Tablet: 768px - 1024px */
@media screen and (max-width: 1024px) {
  .right-sidebar {
    width: 250px;
    padding: 10px;
  }
  
  .news-section {
    margin-top: 100px;
  }
  
  .news-item {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .news-title {
    font-size: 24px;
  }
  
  .footer-info {
    font-size: 10px;
  }
  
  .company-logos {
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(2, 34px);
    gap: 2px;
  }
  
  .company-logo {
    width: 50px;
    height: 34px;
    padding: 2px;
  }
  
  .db-button {
    padding: 6px 10px;
  }
  
  .db-button .main-text {
    font-size: 11px;
  }
}

/* Small tablet / Large phone: 600px - 768px */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
  }
  
  .page-wrapper {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  
  .top-row {
    flex-direction: column;
    overflow: visible;
  }
  
  .left-column {
    width: 100%;
    order: 1;
  }
  
  .main-area {
    order: 2;
    min-height: 400px;
  }
  
  .bottom-row {
    flex-direction: column;
    height: auto;
  }
  
  .product-logos {
    width: 100%;
    padding: 10px;
    height: auto;
  }
  
  .product-logos img {
    width: 22%;
    transform: none !important;
  }
  
  .footer {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 10px;
    align-items: stretch;
  }
  
  .footer-info {
    order: 1;
    text-align: center;
  }
  
  .footer-info div {
    white-space: normal;
    overflow: visible;
    margin-bottom: 5px;
  }
  
  .db-button {
    order: 2;
    width: 100%;
    padding: 12px;
  }
  
  .company-logos {
    order: 3;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 40px);
    gap: 6px;
  }
  
  .company-logo {
    width: auto;
    height: 40px;
    padding: 4px;
  }
  
  /* Right sidebar - below main content */
  .right-sidebar {
    position: relative;
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
  }
  
  .news-section {
    margin-top: 20px;
  }
  
  /* World clocks */
  .world-clocks {
    position: relative;
    top: 0;
    left: 0;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
  }
  
  .clock {
    width: 60px;
    height: 60px;
  }
  
  .hour-hand {
    height: 14px;
  }
  
  .minute-hand {
    height: 18px;
  }
  
  .second-hand {
    height: 22px;
  }
  
  /* Navigation adjustments */
  .nav-item {
    font-size: 16px;
    padding: 12px 16px;
  }
  
  .brochure-btn {
    font-size: 12px;
    padding: 8px 6px;
  }
}

/* Mobile phones: < 600px */
@media screen and (max-width: 600px) {
  .logo-container img {
    height: 50px;
  }
  
  .welcome-text {
    font-size: 14px;
  }
  
  .lang-row {
    flex-wrap: wrap;
  }
  
  .lang-btn {
    flex: 1 1 30%;
    font-size: 11px;
    padding: 6px 4px;
  }
  
  .login-form {
    grid-template-columns: auto 1fr;
    gap: 4px;
  }
  
  .login-form .label {
    padding: 5px 8px;
    font-size: 12px;
  }
  
  .login-form input {
    padding: 5px 6px;
    font-size: 12px;
  }
  
  .login-btn {
    grid-column: 1 / 3;
    grid-row: 3;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
  }
  
  .help-buttons {
    flex-wrap: wrap;
  }
  
  .help-btn {
    flex: 1 1 auto;
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .nav-item {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .brochure-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .brochure-btn {
    font-size: 11px;
    padding: 6px 4px;
  }
  
  .world-clocks {
    gap: 10px;
  }
  
  .clock {
    width: 50px;
    height: 50px;
    border-width: 3px;
  }
  
  .clock-label {
    font-size: 9px;
    padding: 2px 5px;
  }
  
  .hour-hand {
    height: 12px;
    width: 3px;
  }
  
  .minute-hand {
    height: 16px;
    width: 2px;
  }
  
  .second-hand {
    height: 18px;
    width: 1px;
  }
  
  .clock-center {
    width: 6px;
    height: 6px;
  }
  
  .exchange-table {
    font-size: 11px;
  }
  
  .exchange-cell {
    padding: 4px 6px;
    font-size: 10px;
  }
  
  .news-title {
    font-size: 20px;
  }
  
  .news-item {
    font-size: 13px;
    padding: 10px;
  }
  
  .footer-info {
    font-size: 11px;
  }
  
  .company-logos {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 35px);
    gap: 4px;
  }
  
  .company-logo {
    height: 35px;
  }
  
  .db-button .click-text {
    font-size: 10px;
  }
  
  .db-button .main-text {
    font-size: 12px;
  }
}

/* Very small phones: < 400px */
@media screen and (max-width: 400px) {
  .logo-section {
    padding: 6px 8px;
  }
  
  .logo-container img {
    height: 40px;
  }
  
  .welcome-text {
    font-size: 12px;
  }
  
  .nav-item {
    font-size: 13px;
    padding: 8px 10px;
    border-left-width: 5px;
  }
  
  .brochure-grid {
    border-left-width: 5px;
  }
  
  .clock {
    width: 45px;
    height: 45px;
  }
  
  .ampm-indicator {
    font-size: 8px;
  }
}

/* Landscape mode on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .page-wrapper {
    height: auto;
    min-height: 100vh;
  }
  
  .top-row {
    flex-direction: row;
  }
  
  .left-column {
    width: 280px;
  }
  
  .nav-item {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .brochure-btn {
    font-size: 10px;
    padding: 5px 4px;
  }
  
  .logo-container img {
    height: 40px;
  }
  
  .welcome-text {
    font-size: 12px;
    margin: 4px 0;
  }
}
