/* ===================================
   B2 Exam - Unique Responsive Styles
   =================================== */

:root {
  --primary-blue: #1e293b;
  --dark-text: #333333;
  --light-bg: #f5f7fa;
  --white: #ffffff;
  --zebra-row: #f8f9fa;
  --border-color: #e2e8f0;
  --success: #d1fae5;
  --success-border: #10b981;
  --error: #fee2e2;
  --error-border: #ef4444;
  --accent-amber: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background-color: var(--light-bg);
  color: var(--dark-text);
  display: flex;
  flex-direction: column;
  height: 100vh; /* Fixed height on desktop */
}

/* Header */
.header-top {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}

.logo-box {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  padding: 5px 12px;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

.info-top {
  text-align: right;
  font-size: 13px;
  line-height: 1.4;
}

.timer-highlight {
  color: var(--accent-amber);
  font-weight: bold;
}

/* Main Layout Split */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden; /* Prevents whole body scroll on desktop */
  padding: 15px;
  gap: 15px;
}

/* Left Side: Task */
.task-side {
  width: 45%;
  background: var(--white);
  padding: 25px;
  border-radius: 12px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Right Side: Writing */
.writing-side {
  width: 55%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Counter & Check Button */
.word-counter {
  background: var(--white);
  color: var(--primary-blue);
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.counter-left {
  display: flex;
  gap: 15px;
  font-weight: 600;
  font-size: 14px;
}

/* Textarea Container */
.textarea-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea {
  flex: 1;
  width: 100%;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: var(--primary-blue);
}

/* Task Boxes */
.yellow-box {
  background-color: #fffbeb;
  border-left: 4px solid var(--accent-amber);
  padding: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  border-radius: 4px;
  color: #92400e;
  font-weight: 600;
}

.ad-full {
  border: 1px solid var(--border-color);
  padding: 20px;
  background: var(--zebra-row);
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Buttons */
.btn-blue {
  background-color: var(--white);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  padding: 4px 10px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 11px;
  font-weight: bold;
  display: inline-block;
  margin-top: 5px;
  transition: 0.2s;
}

.btn-blue:hover {
  background: var(--primary-blue);
  color: white;
}

.btn-green {
  background-color: var(--success-border);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

/* Correction Panel */
.correction-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
  display: none;
  max-height: 40%;
  overflow-y: auto;
}

.correction-panel.show { display: block; }

/* Responsive adjustments */
@media (max-width: 900px) {
  body {
    height: auto; /* Allow scrolling on mobile */
    overflow-y: auto;
  }

  .main-content {
    flex-direction: column;
    overflow: visible;
  }

  .task-side, .writing-side {
    width: 100%;
  }

  .header-top {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .info-top {
    text-align: center;
  }

  textarea {
    min-height: 300px; /* Ensure space to write on mobile */
  }

  .word-counter {
    flex-direction: column;
    text-align: center;
  }
}

/* Correction Sub-elements */
.error-item {
    background: var(--error);
    border-left: 4px solid var(--error-border);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.suggestion {
    background: var(--success);
    color: #065f46;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid var(--success-border);
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: none;
    z-index: 1000;
}