/* Base Styles */
:root {
  --primary: #0088FE;
  --primary-light: rgba(0, 136, 254, 0.1);
  --primary-dark: #006fd0;
  --secondary: #f5f7fa;
  --foreground: #1a1f2c;
  --background: #f8fafc;
  --muted: #64748b;
  --muted-background: #f1f5f9;
  --border: #e2e8f0;
  --radius: 0.6rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--foreground);
  background-color: var(--background);
  line-height: 1.5;
}

.cc-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cc-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
}

.cc-section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.cc-section-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Header Styles */
.cc-header {
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  width: 100%;
}

.cc-header-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cc-header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cc-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cc-icon {
  background-color: var(--primary-light);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
}

.cc-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.cc-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
}

.cc-project-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 768px) {
  .cc-project-controls {
    width: auto;
    min-width: 300px;
  }
}

.cc-input-group {
  width: 100%;
}

.cc-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 254, 0.1);
}

.cc-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 640px) {
  .cc-button-group {
    justify-content: flex-end;
  }
}

.cc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: white;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.cc-button:hover {
  background-color: var(--secondary);
}

.cc-button.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cc-button i {
  font-size: 0.875rem;
}

.cc-language-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-left: auto;
}

.cc-lang-button {
  padding: 0.5rem 0.75rem;
  border: none;
  background-color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.cc-lang-button.active {
  background-color: var(--primary);
  color: white;
}

/* Main Content */
.cc-main {
  flex: 1;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Summary Section */
.cc-summary {
  background-color: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.cc-summary-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .cc-summary-content {
    flex-direction: row;
  }
}

.cc-summary-details {
  flex: 1;
}

.cc-square-footage {
  margin-bottom: 1.5rem;
}

.cc-label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cc-cost-breakdown {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cc-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.cc-breakdown-value {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cc-percentage {
  color: var(--muted);
  font-size: 0.75rem;
}

.cc-total-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cc-total-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.cc-tooltip {
  position: relative;
  display: inline-block;
  color: var(--muted);
  cursor: help;
}

.cc-tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: white;
  color: var(--foreground);
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  
  /* Position the tooltip */
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  
  /* Fade in/out */
  opacity: 0;
  transition: opacity 0.3s;
}

.cc-tooltip:hover .cc-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.cc-total-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.cc-cost-per-sqft {
  font-weight: 500;
}

.cc-chart-container {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .cc-chart-container {
    width: 250px;
    height: auto;
  }
}

.cc-chart {
  width: 100%;
  height: 100%;
  position: relative;
}

.cc-no-data {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  animation: pulse 2s infinite;
}

.cc-hint {
  font-size: 0.875rem;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Trade Sections */
.cc-trades {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cc-trades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cc-action-buttons {
  display: flex;
  gap: 0.5rem;
}

.cc-action-button {
  background-color: white;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.cc-action-button:hover {
  box-shadow: var(--shadow-md);
}

.cc-trade-section {
  background-color: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}

.cc-trade-section:hover {
  box-shadow: var(--shadow-md);
}

.cc-trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
}

.cc-trade-name {
  font-size: 1.125rem;
  font-weight: 500;
}

.cc-trade-summary {
  margin-left: auto;
  margin-right: 1rem;
  text-align: right;
}

.cc-trade-total {
  font-weight: 500;
}

.cc-trade-item-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.cc-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--muted-background);
  color: var(--foreground);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.cc-trade-section.collapsed .cc-toggle-btn {
  transform: rotate(180deg);
}

.cc-trade-content {
  padding: 0 1rem 1rem;
  animation: slideDown 0.3s ease-out;
}

.cc-trade-section.collapsed .cc-trade-content {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cc-cost-item {
  background-color: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.cc-cost-item:hover {
  box-shadow: var(--shadow-md);
}

.cc-item-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cc-item-name {
  flex: 1;
  min-width: 160px;
}

.cc-item-name-display {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s;
}

.cc-item-name-display:hover {
  background-color: var(--muted-background);
}

.cc-item-cost {
  width: 140px;
}

.cc-currency-input {
  position: relative;
}

.cc-currency-symbol {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.cc-cost-input {
  padding-left: 1.75rem;
  text-align: right;
}

.cc-item-actions {
  display: flex;
  gap: 0.25rem;
}

.cc-item-actions button {
  padding: 0.375rem;
  border-radius: var(--radius);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.cc-item-notes-toggle:hover {
  background-color: var(--muted-background);
  color: var(--foreground);
}

.cc-item-delete:hover {
  background-color: rgba(234, 56, 76, 0.1);
  color: #ea384c;
}

.cc-item-notes {
  margin-top: 0.75rem;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cc-notes-input {
  min-height: 60px;
  resize: vertical;
  font-size: 0.875rem;
}

.cc-add-item-btn, .cc-add-section-btn {
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background-color: white;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s, color 0.2s;
}

.cc-add-item-btn {
  margin-top: 1rem;
}

.cc-add-item-btn:hover, .cc-add-section-btn:hover {
  background-color: var(--muted-background);
  color: var(--foreground);
}

.cc-add-section-btn {
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

/* Features Section */
.cc-features {
  padding: 4rem 0;
  background: linear-gradient(to bottom, var(--background), var(--secondary));
}

.cc-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.cc-feature-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 640px) {
  .cc-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cc-feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cc-feature-card {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeIn 0.5s ease-out;
}

.cc-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.cc-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.cc-feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.cc-feature-description {
  color: var(--muted);
}

/* How To Use Section */
.cc-how-to-use {
  padding: 4rem 0;
}

.cc-steps {
  max-width: 800px;
  margin: 0 auto;
}

.cc-step {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cc-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  flex-shrink: 0;
}

.cc-step-content {
  padding-top: 0.5rem;
}

.cc-step-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.cc-step-description {
  color: var(--muted);
}

/* FAQ Section */
.cc-faq {
  padding: 2rem 0 4rem;
}

.cc-accordion {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cc-accordion-item {
  border-bottom: 1px solid var(--border);
}

.cc-accordion-item:last-child {
  border-bottom: none;
}

.cc-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cc-accordion-header:hover {
  background-color: var(--secondary);
}

.cc-accordion-header h3 {
  font-size: 1rem;
  font-weight: 500;
}

.cc-accordion-icon {
  transition: transform 0.3s;
}

.cc-accordion-item.active .cc-accordion-icon {
  transform: rotate(180deg);
}

.cc-accordion-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.cc-accordion-item.active .cc-accordion-content {
  padding: 1rem 1.5rem;
  max-height: 500px;
}

.cc-accordion-content p {
  color: var(--muted);
}

/* Toast Notification */
.cc-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  transform: translateY(150%);
  transition: transform 0.3s;
  z-index: 1000;
}

.cc-toast.show {
  transform: translateY(0);
}

.cc-toast-content {
  background-color: var(--foreground);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 350px;
}

.cc-toast.success .cc-toast-content {
  background-color: #10b981;
}

.cc-toast.error .cc-toast-content {
  background-color: #ef4444;
}

/* Animation Utilities */
.cc-animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.cc-animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.cc-animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Queries for Responsive Design */
@media print {
  .cc-app {
    background: white;
  }
  
  .cc-header, .cc-feature-section, .cc-how-to-use, .cc-faq {
    display: none;
  }
  
  .cc-trade-section {
    break-inside: avoid;
  }
}
