/* styles.css - Nokia / BMO Classic Theme */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* Base Variables - Light Mode (Cute Lofi Nokia) */
:root {
  --font-family: 'VT323', 'Courier New', monospace;
  --bg-color: #eae7e3;
  /* warm cozy grey */
  --screen-bg: #b4c7b8;
  /* soft cute matcha green */
  --screen-text: #3c423d;
  /* warm dark grey-green instead of harsh black */
  --device-shell: #465c7a;
  /* soft dusty pastel navy */
  --accent: #465c7a;
  --btn-bg: #e6e8e6;
  /* cute off-white buttons */
  --btn-text: #465c7a;
  --border-light: #7b8b9f;
  /* soft bezel highlight */
  --border-dark: #2c3e55;
  --screen-border: #647368;
  /* softer screen border */
  --border-radius: 12px;
}

/* Dark Mode Overrides (Cozy Lofi Night Nokia) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1824;
    /* cozy dark purple night */
    --device-shell: #465c7a;
    /* use the same cute blue everywhere */
    --screen-bg: #b4c7b8;
    /* muted cozy green */
    --screen-text: #242926;
    --accent: #e6e8e6;
    --btn-bg: #e6e8e6;
    --btn-text: #465c7a;
    /* use the same cute blue everywhere */
    --border-light: #52637a;
    --border-dark: #1b263b;
    --screen-border: #56665a;
  }
}

/* Global Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--screen-text);
  min-height: 100vh;
  line-height: 1.2;
}

/* Typography elements */
h1,
h2,
h3,
h4 {
  font-weight: normal;
  margin-bottom: 0.5rem;
}

a {
  color: #111;
  text-decoration: underline;
}

a:hover {
  text-decoration: none;
}

/* Container / Device Shell */
.container {
  max-width: 500px;
  width: 95%;
  /* ensures responsive gap on mobile */
  margin: 20px auto;
  /* Added a small margin to show the top curves */
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* The Nokia Device Shell */
.nokia-device {
  background: var(--device-shell);
  border-radius: 40px;
  /* Softer, cuter shape */
  /* chunky hardware bezel */
  border: 4px solid var(--border-light);
  /* 3D hardware bezel matching the navigation bar */
  box-shadow:
    inset 4px 4px 12px rgba(255, 255, 255, 0.3),
    inset -4px -4px 12px rgba(0, 0, 0, 0.4),
    10px 10px 20px rgba(0, 0, 0, 0.5);
  padding: 30px 15px 40px 15px;
  /* Thinner left and right bezel */
}

.device-header {
  color: var(--border-light);
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 10px 10px;
  text-transform: uppercase;
}

.lang-dropdown {
  background: rgba(0, 0, 0, 0.2);
  /* slightly darker background for contrast */
  color: #fff;
  /* bright white text so it's not grayed out */
  border: 1px solid rgba(255, 255, 255, 0.4);
  /* subtle white border */
  border-radius: 10px;
  /* softer dropdown */
  font-family: var(--font-family);
  font-size: 1rem;
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
}

.lang-dropdown option {
  background: var(--device-shell);
  color: #fff;
}

/* The LCD Screen */
.nokia-screen {
  background: var(--screen-bg);
  border: 5px solid var(--screen-border);
  /* thick inner screen border */
  border-radius: 20px;
  /* cuter round screen */
  padding: 20px 35px;
  /* Push content away from the edges */
  color: var(--screen-text);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.2);
  /* inset screen shadow */
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

/* Cozy Lofi Scanlines */
.nokia-screen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(255, 255, 255, 0) 50%,
      rgba(0, 0, 0, 0.02) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
}

.screen-divider {
  border: 0;
  border-top: 2px dotted var(--screen-border);
  margin: 10px 0;
}

/* Sections inside screen */
.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-title {
  font-weight: bold;
  font-size: 1.4rem;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 5px;
  border-bottom: 2px solid var(--screen-border);
}

.tagline {
  color: var(--screen-text);
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Intro Layout (Hero Image) */
.intro-layout {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hero-image-container {
  width: 80px;
  height: 80px;
  border: 3px solid var(--screen-border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-text h1 {
  font-size: 1.8rem;
}

/* Portfolio Grid */
.portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.porto-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 2px solid var(--screen-border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
}

.porto-card h3 {
  font-size: 1.2rem;
  color: var(--screen-text);
  margin-bottom: 0.5rem;
}

.porto-img-container {
  width: 100%;
  height: 120px;
  background: #000;
  border: 3px inset #333;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.porto-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* Form Styles */
.nokia-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

input[type="text"],
textarea {
  background: transparent;
  border: 2px solid var(--screen-border);
  border-radius: 4px;
  color: var(--screen-text);
  padding: 0.5rem;
  font-family: var(--font-family);
  font-size: 1.2rem;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: #000;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-label {
  cursor: not-allowed;
}

/* Buttons (Hardware Keys) */
.btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 3px outset var(--border-light);
  border-radius: 30px;
  /* cute pill shape */
  padding: 0.5rem 1rem;
  font-family: var(--font-family);
  font-size: 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: inset 1px 1px 4px rgba(255, 255, 255, 0.7), 2px 2px 4px rgba(0, 0, 0, 0.3);
  align-self: center;
  /* center the form button */
  min-width: 120px;
}

.btn:active {
  border-style: inset;
  transform: translate(1px, 1px);
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.small-btn {
  padding: 0.25rem 0.5rem;
  min-width: 80px;
  white-space: nowrap;
  /* prevent awkward text breaking on long translations */
  font-size: 1rem;
  /* slightly smaller to fit better */
}

/* Flat Screen Buttons (Nokia Box Style) */
.flat-btn {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(0, 0, 0, 0.1);
  color: var(--screen-text);
  border: 2px solid var(--screen-border);
  border-radius: 0; /* Kotak/Square */
  text-decoration: none;
  font-family: var(--font-family);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.flat-btn:hover {
  background: var(--screen-text);
  color: var(--screen-bg);
}

/* Zen Garden / System Architecture Container */
.garden-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  /* allow wrapping on tiny mobile screens */
  gap: 10px;
  margin-bottom: 0.5rem;
}

.scope-label {
  font-weight: bold;
  background: transparent;
  border: 2px dotted var(--screen-border);
  padding: 4px 8px;
  border-radius: 6px;
}

/* System Architecture List */
.nokia-list-container {
  width: 100%;
  height: 152px; /* Set height to fit exactly 4 rows of items perfectly */
  background-color: transparent;
  border: 2px solid var(--screen-border);
  border-radius: 6px;
  overflow-y: auto;
}

/* Scrollbar for list container */
.nokia-list-container::-webkit-scrollbar {
  width: 8px;
}

.nokia-list-container::-webkit-scrollbar-track {
  background: transparent;
  border-left: 2px solid var(--screen-border);
}

.nokia-list-container::-webkit-scrollbar-thumb {
  background: var(--screen-border);
  border-radius: 4px;
}

.system-list {
  display: flex;
  flex-direction: column;
}

.system-item {
  display: flex;
  align-items: center;
  gap: 10px; /* Thinner gap */
  padding: 6px 12px; /* Thinner padding */
  border-bottom: 2px dotted var(--screen-border);
  cursor: pointer;
  transition: background 0.2s;
}

.system-item:hover {
  background: rgba(0, 0, 0, 0.1);
}

.system-icon {
  font-size: 1.4rem; /* Thinner icon size */
  color: var(--screen-text);
  text-shadow: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.system-icon-wrapper {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.system-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

.system-name {
  font-weight: bold;
  font-size: 1.15rem; /* Thinner font size */
  color: var(--screen-text);
}

/* Footer */
.nokia-footer {
  text-align: center;
  padding: 1rem;
  font-size: 1.2rem;
  color: var(--device-shell);
}

/* Responsive fixes */
@media (max-width: 600px) {
  .container {
    width: 95%;
    /* give a tiny bit of breathing room from browser edge */
  }

  .nokia-device {
    padding: 15px 10px 25px 10px;
    /* Thinner side padding on mobile */
    border-width: 2px;
    /* Thinner outer bezel */
    border-radius: 20px;
    /* Slightly less round to save space */
  }

  .nokia-screen {
    border-width: 3px;
    /* Thinner inner bezel */
    padding: 15px 20px;
    /* More margin between content and frame */
  }

  .intro-layout {
    flex-direction: column;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

.social-links {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.15rem;
  border-radius: 6px;
  text-decoration: none;
}

/* RTL Text Mode (Arabic) */
body.rtl-mode .nokia-screen p,
body.rtl-mode .nokia-screen h1,
body.rtl-mode .nokia-screen h2,
body.rtl-mode .nokia-screen h3,
body.rtl-mode .nokia-screen label,
body.rtl-mode .nokia-screen input,
body.rtl-mode .nokia-screen textarea {
  text-align: right;
  direction: rtl;
  /* ensures punctuation flow is correct for Arabic */
}

/* Keep intro text aligned right in desktop, but if mobile centers it, let mobile center override */
@media (min-width: 601px) {
  body.rtl-mode .intro-text {
    width: 100%;
    /* forces it to take space so right-align works relative to container */
  }
}

/* Ensure buttons stay centered */
body.rtl-mode .btn {
  text-align: center;
}