:root {
  --bg-white: #ffffff;
  --bg-dark: #000000;
    --text-white: #111111;
    --text-dark: var(--bg-white);
  --primary: #007aff;
  --nav: #0077b6;
  --gray: #f2f2f2;
  --font: "Inter", sans-serif;
  --success: #28a745;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font);
}

body {
  background: var(--bg-dark);
  color: var(--text-dark);
  line-height: 1.5;
}

/* Navigation Styles */
nav {
  height: 7vh;
  margin-bottom: 20px;
  width: 100%;
  background-color: var(--nav);
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-content {
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.nav-content .leftDiv {
  display: flex;
  flex-direction: row;
  color: white;
  gap: 3px;
}

.nav-content .leftDiv span {
  font-size: 20px;
  font-weight: 100;
  font-style: italic;
}

.nav-content .leftDiv p {
  font-size: 20px;
  font-weight: bolder;
}

.nav-content .rightDiv {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 30px;
}

.nav-content .rightDiv a {
  border: 1px solid white;
  padding: 5px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: white;
}

.nav-content .rightDiv a:hover {
  font-weight: bold;
}

/* Main content alignment with navbar */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Upload Section */
.upload-section {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.upload-box {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
}

.upload-box:hover {
  border-color: var(--primary);
  background: var(--gray);
}

/* Tone Selector Section */
.tone-selector {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding: 12px;
  align-items: center;
  border-bottom: 1px solid #c9c9c9;
  margin-bottom: 20px;
}

.tone-selector .chooseTone {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.tone-selector label {
  font-weight: 600;
  font-size: 1rem;
  color: #000000;
  margin-right: 10px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

#tone {
  padding: 0.3rem 1rem;
  border-radius: 8px;
  border: 1px solid #c9c9c9;
  background: linear-gradient(135deg, #f2f2f2 0%, #e9ecef 100%);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  outline: none;
}

#tone:focus {
  border-color: #00244b;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
  background: linear-gradient(135deg, #e9ecef 0%, #f2f2f2 100%);
  color: #00244b;
  cursor: pointer;
}

/* Preview Section */
.preview-section {
  display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0;
}

.text-panel {
  background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .text-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.word-count,
.ai-status {
  background: rgba(0, 122, 255, 0.2);
  color: #007aff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(0, 122, 255, 0.3);
}

.ai-status {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border-color: rgba(40, 167, 69, 0.3);
}

.textarea-container {
  position: relative;
  height: 300px;
}

.text-panel textarea {
  width: 100%;
    height: 100%;
    resize: vertical;
    min-height: 300px;
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .text-panel textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
  }
  
  .text-panel textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
  }
  
  .textarea-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
  }
.text-panel textarea:not(:placeholder-shown)+.textarea-overlay {
  opacity: 0;
}

.upload-prompt,
.ai-prompt {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.upload-icon,
.ai-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.upload-prompt p,
.ai-prompt p {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

/* Button Styles */
.submitTone {
  background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
  color: white;
  padding: 0.45rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.submitTone:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
  background: linear-gradient(135deg, #0056b3 0%, var(--primary) 100%);
}

.submitTone:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 122, 255, 0.2);
}

/* Actions Section */
.actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.actions button {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    justify-content: center;
  }
  
  /* Primary Action Button (Analyze with AI) */
  .actions button:nth-child(1) {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
  }
  
  .actions button:nth-child(1):hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  }
  
  /* Secondary Action Button (Download) */
  .actions button:nth-child(2) {
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
  }
  
  .actions button:nth-child(2):hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
    background: linear-gradient(135deg, #0056b3 0%, var(--primary) 100%);
  }
  
  /* Clear Button (Destructive action) */
  .actions button:nth-child(3) {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
}

.actions button:nth-child(3):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
  background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
}

/* Disabled Button State */
.actions button:disabled {
  background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
  color: #fff;
    opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.1);
  }
  
  .actions button:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.1);
  }
  
  /* Active/Focus States */
  .actions button:active:not(:disabled) {
    transform: translateY(0);
  }
  
  .actions button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Theme Toggle Slider Styles */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin-right: 15px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
.slider:after {
  content: "🌙";
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  font-size: 12px;
  transition: all 0.3s ease;
  opacity: 1;
}

input:checked+.slider {
  background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
}

input:checked+.slider:before {
  transform: translateX(30px);
  background: linear-gradient(135deg, #ffffff 0%, #fff3cd 100%);
}

input:checked+.slider:after {
  content: "☀️";
  left: 40px;
}

/* Hover effects */
.theme-switch:hover .slider {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-switch:active .slider {
  transform: scale(0.98);
}

/* Focus styles for accessibility */
.theme-switch input:focus+.slider {
  outline: 2px solid #4285f4;
  outline-offset: 2px;
}

/* Theme Classes */
body.light-theme {
  background: var(--bg-white);
  color: var(--text-white);
}

body.dark-theme {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* Light theme specific styles */
body.light-theme .upload-box {
  border-color: #ddd;
  background: #f9f9f9;
}

body.light-theme .upload-box:hover {
  border-color: var(--primary);
  background: var(--gray);
}

body.light-theme .text-panel {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-theme .text-panel:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .panel-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .text-panel textarea {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-white);
}

body.light-theme .text-panel textarea:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .text-panel textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .textarea-overlay {
  background: rgba(0, 0, 0, 0.01);
}

body.light-theme .upload-prompt,
body.light-theme .ai-prompt {
  color: rgba(0, 0, 0, 0.5);
}

body.light-theme .tone-selector {
  border-bottom: 1px solid #c9c9c9;
}

body.light-theme .tone-selector label {
  color: #000000;
}

body.light-theme .submitTone,
body.light-theme .actions button {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .submitTone:hover,
body.light-theme .actions button:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

body.light-theme .actions button:disabled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
/* Dark theme specific styles */
body.dark-theme .upload-box {
  border-color: #555;
  background: #1a1a1a;
  color: white;
}

body.dark-theme .upload-box:hover {
  border-color: var(--primary);
  background: #2a2a2a;
}

body.dark-theme .text-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .text-panel:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .text-panel textarea {
  background: #1a1a1a;
  color: white;
  border-color: #555;
}

body.dark-theme .tone-selector {
  border-bottom: 1px solid #444;
}

body.dark-theme .tone-selector label {
  color: #fff;
}

body.dark-theme #tone {
  background: #1a1a1a;
  color: #fff;
  border-color: #555;
}

/* Responsive design */
@media (max-width: 768px) {
  main {
    padding: 0 1rem;
  }

    .nav-content {
      padding: 0 1rem;
    }

    .preview-section {
      grid-template-columns: 1fr;
      gap: 1.5rem;
  }

  .actions {
    gap: 1rem;
  }
.actions button {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  min-width: 160px;
}

    .submitTone {
      padding: 0.65rem 1.25rem;
      font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
  main {
      padding: 0 0.5rem;
    }
  
    .nav-content {
      padding: 0 0.5rem;
    }
  .actions {
    flex-direction: column;
    align-items: center;
  }

  .actions button {
    width: 100%;
    max-width: 280px;
  }
}