/* ==================== MODERN UI STYLES ==================== */

:root {
  --primary-bg: #1a1a1a;
  --secondary-bg: #2e2e2e;
  --tertiary-bg: #3b3b3b;
  --card-bg: rgba(46, 46, 46, 0.8);
  --border-color: rgba(215, 215, 215, 0.1);
  --text-primary: #e0e0e0;
  --text-secondary: #a9a9a9;
  --accent-primary: #d79333;
  --accent-secondary: #d7d7d7;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #007bff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Lexend Deca", sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  min-height: 100vh;
  font-size: 1.5rem;
  width: 100%;
  padding: 1rem 0;
}

/* ==================== HEADER / TOP SECTION ==================== */

#top {
  width: 100%;
  margin: 0;
  padding: 1.5rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

#top:hover {
  box-shadow: var(--shadow-lg);
}

#top > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d79333 0%, #f5c876 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(215, 147, 51, 0.3);
  letter-spacing: -0.5px;
}

h2 {
  margin: 0 0 1.5rem 0;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  border-radius: 2px;
}

h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ==================== CONNECTION STATUS ==================== */

#connection-status {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  display: inline-block;
  background: rgba(255, 193, 7, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 193, 7, 0.3);
  transition: all 0.3s ease;
}

#connection-status::before {
  content: '●';
  display: inline-block;
  margin-right: 0.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==================== BUTTONS ==================== */

button {
  font-family: 'Lexend Deca', sans-serif;
  padding: 0.7rem 1.8rem;
  margin: 0.3rem;
  background: linear-gradient(135deg, #2e2e2e 0%, #3b3b3b 100%);
  border: 1.5px solid rgba(215, 215, 215, 0.2);
  border-radius: 10rem;
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
  min-width: 90px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::before {
  width: 300px;
  height: 300px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(215, 215, 215, 0.4);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button.off {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border-color: rgba(220, 53, 69, 0.5);
}

button.off:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
  border-color: rgba(220, 53, 69, 0.7);
}

.reconnect-btn {
  display: inline-block;
  margin-left: 10px;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: 1px solid rgba(0, 123, 255, 0.3);
  border-radius: 2rem;
  cursor: pointer;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.reconnect-btn.hidden {
  display: none !important;
}

.reconnect-btn:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#admin-btn, #logout-btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Lexend Deca', sans-serif;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

#logout-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  border-color: rgba(255, 107, 107, 0.3);
}

#admin-btn:hover, #logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.95;
}

.clear-log-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.clear-log-btn:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==================== DEVICE SELECTOR ==================== */

#device-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  padding: 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

#device-selector label {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
  white-space: nowrap;
}

#device-selector select {
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  background: var(--primary-bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  font-size: 1rem;
  font-family: 'Lexend Deca', sans-serif;
  min-width: 250px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

#device-selector select:hover {
  border-color: rgba(215, 147, 51, 0.5);
  box-shadow: var(--shadow-sm);
}

#device-selector select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(215, 147, 51, 0.2);
}

/* ==================== USER INFO ==================== */

#user-info {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-right: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(46, 46, 46, 0.5);
  border-radius: 2rem;
  border: 1px solid var(--border-color);
}

/* ==================== CARDS / PANELS ==================== */

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

#controlpanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 2rem;
}

#relay_parent,
#wol_parent {
  display: flex;
  flex-direction: column;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 1200px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 2rem;
  box-sizing: border-box;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease;
}

#relay_parent:hover,
#wol_parent:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.relaygroup {
  display: flex;
  padding: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.relay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1.5rem;
  background: rgba(26, 26, 26, 0.5);
  border-radius: 1.2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  min-width: 140px;
}

.relay:hover {
  background: rgba(26, 26, 26, 0.7);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.relay_status {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: 10px;
  background-color: #666;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(102, 102, 102, 0.5);
  transition: all 0.3s ease;
  position: relative;
}

.relay_status::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.relay_status.on {
  background-color: var(--success);
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
  animation: pulseGlow 2s infinite;
}

.relay_status.off {
  background-color: var(--danger);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
  }
  50% {
    box-shadow: 0 0 25px rgba(40, 167, 69, 0.9);
  }
}

/* ==================== WOL STYLES ==================== */

#wol_list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wol_device {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem;
  background: rgba(26, 26, 26, 0.5);
  border-radius: 1.2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.wol_device::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(215, 147, 51, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wol_device:hover::before {
  opacity: 1;
}

.wol_device:hover {
  background: rgba(26, 26, 26, 0.7);
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

.wol_infogroup {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

.wol_status {
  width: 8px;
  height: 3.5rem;
  background-color: #555;
  border-radius: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.wol_status::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Running durumu - yeşil glow */
.wol_status[style*="#0f0"],
.wol_status[style*="rgb(0, 255, 0)"] {
  background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
  box-shadow: 0 0 12px rgba(40, 167, 69, 0.6);
  animation: wolPulse 2s ease-in-out infinite;
}

/* Offline durumu - gri */
.wol_status[style*="#555"],
.wol_status[style*="rgb(85, 85, 85)"] {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Booting durumu - sarı */
.wol_status[style*="#ff0"],
.wol_status[style*="rgb(255, 255, 0)"] {
  background: linear-gradient(180deg, #ffc107 0%, #ff9800 100%);
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.6);
  animation: wolPulse 1.5s ease-in-out infinite;
}

@keyframes wolPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(0.95);
  }
}

.wol_texts {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wol_name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  position: relative;
}

.wol_statustext {
  font-size: 0.9rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wol_statustext::before {
  content: '●';
  font-size: 0.6rem;
  opacity: 0.6;
}

.wol_button {
  margin-left: auto;
}

/* ==================== LOG SECTION ==================== */

#log_parent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

#log {
  background: rgba(17, 17, 17, 0.9);
  color: #00ff88;
  padding: 1.5rem;
  font-size: 0.9rem;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 800px;
  text-align: left;
  height: 350px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 255, 136, 0.2);
  font-family: 'Courier New', monospace;
  line-height: 1.6;
}

#log::-webkit-scrollbar {
  width: 8px;
}

#log::-webkit-scrollbar-track {
  background: rgba(17, 17, 17, 0.5);
  border-radius: 4px;
}

#log::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.3);
  border-radius: 4px;
}

#log::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 136, 0.5);
}

/* ==================== TOAST CONTAINER ==================== */

#toast-container {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.hidden {
  display: none !important;
}

/* ==================== ANIMATIONS ==================== */

@keyframes pop {
  0%   { transform: scale(1); }
  5%   { transform: scale(.98); }
  20%  { transform: scale(.95); }
  40%  { transform: scale(.96); }
  50%  { transform: scale(1.05); }
  95%  { transform: scale(.99); }
  100% { transform: scale(1); }
}

.animate {
  animation: pop .4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet ve küçük ekranlar */
@media (max-width: 768px) {
  body {
    font-size: 1.2rem;
    gap: 1.2rem;
    padding: 0.5rem;
  }

  .main-container {
    padding: 0 0.5rem;
    gap: 1.2rem;
  }

  #top {
    padding: 1rem;
    border-radius: 1.2rem;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  #top > div {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  #top > div > div:last-child {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  #connection-status {
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    margin-top: 0.8rem;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }

  #reconnect-btn {
    margin-top: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  #device-selector {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    padding: 1rem;
  }

  #device-selector label {
    font-size: 1rem;
  }

  #device-selector select {
    min-width: 100%;
    font-size: 1rem;
    padding: 0.9rem 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  #user-info {
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    margin: 0.3rem;
  }

  #admin-btn, #logout-btn {
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
    min-height: 44px; /* Touch-friendly */
    min-width: 80px;
  }

  .log-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .clear-log-btn {
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
    min-height: 44px;
  }

  button {
    font-size: 1rem;
    padding: 0.8rem 1.6rem;
    min-height: 44px; /* Touch-friendly minimum size */
    min-width: 100px;
  }

  #relay_parent,
  #wol_parent {
    padding: 1.2rem;
    border-radius: 1.2rem;
  }

  h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .wol_device {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(26, 26, 26, 0.6);
    box-shadow: var(--shadow-md);
  }

  .wol_device:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }

  .wol_device::before {
    display: none;
  }

  .wol_status {
    width: 100%;
    height: 6px;
    border-radius: 0;
    position: relative;
    margin: 0;
    box-shadow: none;
    flex-shrink: 0;
  }

  .wol_infogroup {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1rem;
    width: 100%;
  }

  .wol_status_indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
    transition: all 0.3s ease;
  }

  .wol_texts {
    flex: 1;
    min-width: 0;
  }

  .wol_name {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }

  .wol_statustext {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  .wol_button {
    width: 100%;
    margin-left: 0;
    min-height: 48px;
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    font-weight: 600;
    background: linear-gradient(135deg, #2e2e2e 0%, #3b3b3b 100%);
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
  }

  .wol_button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
  }

  .wol_button:active::before {
    left: 100%;
  }

  .wol_button:hover {
    background: linear-gradient(135deg, #3b3b3b 0%, #4a4a4a 100%);
    transform: none;
  }

  .wol_button:active {
    transform: scale(0.98);
  }

  #wol_list {
    gap: 0.8rem;
  }

  .relaygroup {
    padding: 0.5rem;
    gap: 1rem;
    justify-content: center;
  }

  .relay {
    min-width: 140px;
    padding: 1.2rem;
    flex: 0 1 calc(50% - 0.5rem);
    max-width: 180px;
  }

  .relay button {
    width: 100%;
    min-width: auto;
  }

  #log {
    height: 280px;
    font-size: 0.85rem;
    padding: 1rem;
    border-radius: 1.2rem;
  }

  /* Toast container mobilde ortada */
  #toast-container {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 400px;
    align-items: center;
  }
}

/* Küçük mobil cihazlar */
@media (max-width: 480px) {
  body {
    font-size: 1.1rem;
    gap: 1rem;
    padding: 0.3rem;
  }

  .main-container {
    padding: 0;
    gap: 1rem;
  }

  #top {
    padding: 0.8rem;
    border-radius: 1rem;
    margin: 0 0.5rem;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
  }

  #connection-status {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    margin-top: 0.5rem;
  }

  #device-selector {
    padding: 0.8rem;
    margin: 0 0.5rem;
  }

  #device-selector label {
    font-size: 0.9rem;
  }

  #device-selector select {
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
  }

  #user-info {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem;
  }

  #admin-btn, #logout-btn {
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
    min-height: 40px;
    min-width: 70px;
  }

  .reconnect-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    min-height: 40px;
  }

  .clear-log-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    min-height: 40px;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
  }

  h3 {
    font-size: 1rem;
  }

  #relay_parent,
  #wol_parent {
    padding: 1rem;
    margin: 0 0.5rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.7rem 1.3rem;
    min-height: 42px;
    min-width: 90px;
  }

  .relaygroup {
    padding: 0.3rem;
    gap: 0.8rem;
  }

  .relay {
    min-width: calc(50% - 0.4rem);
    max-width: none;
    padding: 1rem;
    flex: 1 1 calc(50% - 0.4rem);
  }

  .relay button {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    min-height: 40px;
  }

  .wol_device {
    border-radius: 0.9rem;
  }

  .wol_infogroup {
    padding: 1rem 0.9rem;
    gap: 0.8rem;
  }

  .wol_name {
    font-size: 1rem;
  }

  .wol_statustext {
    font-size: 0.8rem;
  }

  .wol_button {
    min-height: 44px;
    font-size: 0.9rem;
  }

  #log {
    height: 250px;
    font-size: 0.8rem;
    padding: 0.8rem;
    margin: 0 0.5rem;
  }

  .log-header {
    padding: 0 0.5rem;
  }

  /* Toast container çok küçük ekranlarda */
  #toast-container {
    width: calc(100% - 1rem);
    max-width: none;
    bottom: 1rem;
  }
}

/* Yatay mod (landscape) optimizasyonu */
@media (max-width: 768px) and (orientation: landscape) {
  body {
    gap: 1rem;
    padding: 0.3rem 0;
  }

  #log {
    height: 200px;
  }

  #top {
    padding: 0.8rem 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }
}

