/* LaTeX Editor Specific Styles */

.tool-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 5% 50px;
    min-height: 100vh;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

.latex-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
}

.toolbar .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.spacer {
    flex: 1;
}

.display-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.toggle-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Workspace */
.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    height: 500px;
}

.pane {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.error-msg {
    color: #ff6b6b;
    font-size: 0.85rem;
    font-weight: 500;
}

.custom-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 1rem;
    padding: 20px;
    resize: none;
    outline: none;
    line-height: 1.6;
}

.preview-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff; /* White background for math to match typical document style */
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 0 0 15px 15px;
}

/* Make sure KaTeX display mode centers and scrolls properly if too wide */
.katex-display {
    margin: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
}

/* Examples Section */
.examples-section {
    margin-top: 10px;
}

.examples-section h3 {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .editor-pane {
        height: 350px;
    }
    
    .preview-pane {
        height: 350px;
    }
}
