/* Styles extracted from x-o.html */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 20px;
}

h2 {
  text-align: center;
  color: #4a5568;
  margin-bottom: 30px;
  font-size: 2.2em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.section {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 10px;
  background: #f8f9fa;
  border-left: 4px solid #667eea;
}

label {
  font-weight: 600;
  color: #2d3748;
  display: block;
  margin-bottom: 10px;
}

input[type="file"] {
  padding: 10px;
  border: 2px dashed #667eea;
  border-radius: 8px;
  background: white;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="file"]:hover {
  border-color: #764ba2;
  background: #f0f0ff;
}

#drawCanvas {
  border: 3px solid #667eea;
  cursor: crosshair;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background: white;
  transition: all 0.3s ease;
}

#drawCanvas:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

#controls {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

button:first-child {
  background: #e53e3e;
  color: white;
}

button:first-child:hover {
  background: #c53030;
  transform: translateY(-2px);
}

button:last-child {
  background: #667eea;
  color: white;
}

button:last-child:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

#result {
  margin-top: 20px;
  padding: 15px;
  background: #e6fffa;
  border-radius: 8px;
  border-left: 4px solid #38b2ac;
  font-weight: 600;
  font-size: 16px;
  color: #234e52;
}

.code-section {
  background: #1a202c;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
  overflow-x: auto;
}

.code-section h3 {
  color: #e2e8f0;
  margin-bottom: 15px;
  font-size: 1.4em;
}

.code-block {
  background: #2d3748;
  border-radius: 8px;
  padding: 20px;
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid #4a5568;
}

.keyword { color: #63b3ed; }
.string { color: #68d391; }
.comment { color: #a0aec0; font-style: italic; }
.function { color: #f6ad55; }
.number { color: #fc8181; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px;
  }
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.lang-btn {
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #667eea;
  border-radius: 20px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.lang-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
}

.lang-btn.active {
  background: #667eea;
  color: white;
}

/* RTL Support for Arabic */
.rtl {
  direction: rtl;
  text-align: right;
}

.rtl .language-switcher {
  right: auto;
  left: 20px;
}

.rtl .section {
  border-left: none;
  border-right: 4px solid #667eea;
}

.rtl #controls {
  justify-content: flex-end;
}

.rtl .grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .rtl .grid {
    grid-template-columns: 1fr;
  }
}

/* Explanation Section Styles */
.explanation-section {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
}

.explanation-section h3 {
  color: white;
  margin-bottom: 20px;
  font-size: 1.6em;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.explanation-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 20px;
}

.explanation-item {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.explanation-item h4 {
  color: #2d3748;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.explanation-item ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.explanation-item li {
  margin-bottom: 8px;
  color: #4a5568;
  line-height: 1.6;
  font-size: 14px;
}

.explanation-note {
  background: #e6fffa;
  border: 2px solid #38b2ac;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
}

.explanation-note p {
  margin: 0;
  color: #234e52;
  font-weight: 600;
  font-style: italic;
}

/* RTL Support for Explanation */
.rtl .explanation-item {
  border-left: none;
  border-right: 4px solid #667eea;
}

.rtl .explanation-item ul {
  padding-right: 0;
  padding-left: 20px;
}
