/* Existing styles ... */

/* Apple-like styling overrides */
body {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

/* Container spacing */
.container {
  max-width: 1200px;
  padding: 2rem;
}

/* Section spacing */
.mb-8 {
  margin-bottom: 3rem;
}

/* Section headers */
h3.text-xl {
  font-size: 1.5rem;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 1.5rem;
}

/* Input styling */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border-color: #e5e5e5;
  transition: all 0.2s ease;
  background-color: #f5f5f7;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: #0066cc;
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* Button styling */
button {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.bg-blue-500 {
  background-color: #0066cc;
}

.bg-blue-500:hover {
  background-color: #0055b3;
}

/* Tab styling */
.tab-btn {
  font-weight: 500;
  padding: 1rem 1.5rem;
  color: #1d1d1f;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: #0066cc;
  opacity: 1;
  font-weight: 600;
}

/* Settings panel */
.settings-panel {
  background-color: #f5f5f7;
  border-radius: 1rem;
  padding: 1.5rem;
}

/* Link items */
.link-item {
  background-color: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #e5e5e5;
  transition: all 0.2s ease;
}

.link-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Preview panel */
.preview-panel {
  padding: 3rem;
  background-color: #f5f5f7;
}

/* Font sizes */
.text-2xl {
  font-size: 2rem;
  line-height: 1.2;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.4;
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  margin: 1rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0066cc;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Modal styling */
.add-modal-content,
.mobile-preview-content,
.font-search-content {
  border-radius: 1.25rem;
  padding: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .mb-8 {
    margin-bottom: 2rem;
  }
}

/* Rest of existing styles ... */

.sortable-ghost {
  opacity: 0.5;
}

.link-item {
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.link-item:hover {
  transform: translateY(-2px);
}

.link-item input {
  min-width: 0; /* Allows inputs to shrink properly */
}

.link-item input[type="range"] {
  cursor: pointer;
}

.link-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

.link-item input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

.preview-link {
  transition: transform 0.2s ease;
}

.preview-link:hover {
  transform: scale(1.02);
}

.preview-link img {
  border-radius: 0;
}

.social-icon {
  transition: all 0.3s ease;
  width: 40px !important; /* Force consistent width */
  height: 40px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon i {
  width: 16px; /* Set fixed width for icons */
  text-align: center;
}

.social-icon:hover {
  transform: rotate(360deg);
}

/* Theme Styles */
.theme-gradient {
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.theme-dark {
  background-color: #1f2937;
  color: white;
}

.theme-light {
  background-color: white;
  color: #1f2937;
}

/* Loading animation */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Preview Panel Styles */
@media (min-width: 1024px) {
  .preview-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 40%;
    max-width: 40%;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 2rem;
  }
}

/* Mobile Preview Modal */
.mobile-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: none;
}

.mobile-preview-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-preview-content {
  background: white;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  margin: 1rem;
  border-radius: 0.5rem;
  overflow-y: auto;
}

/* Mobile Preview Button */
.mobile-preview-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 40;
}

@media (min-width: 1024px) {
  .mobile-preview-btn {
    display: none;
  }
}

/* Add Button Menu Styles */
.add-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.add-modal.active {
  display: flex;
}

.add-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.add-menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  width: 100%;
  text-align: left;
  border-radius: 0.375rem;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
}

.add-menu-item:hover {
  background: #f3f4f6;
}

.add-menu-item i {
  width: 1.5rem;
  margin-right: 0.75rem;
  text-align: center;
}

.alignment-btn.bg-blue-500 {
  background-color: #3b82f6;
  color: white;
}

#fontSelect option {
  padding: 8px;
}

.preview-container {
  transition: font-family 0.3s ease;
}

/* Add button wrapper for positioning */
.add-button-wrapper {
  position: relative;
  display: inline-block;
}

/* Font Search Modal */
.font-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.font-search-modal.active {
  display: flex;
}

.font-search-content {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.font-option {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 0.25rem;
}

.font-option:hover {
  background-color: #f3f4f6;
}

/* Settings Panel Styles */
.settings-panel {
  transition: all 0.3s ease;
  min-width: unset;
  position: static;
  box-shadow: none;
}

.settings-panel input[type="color"] {
  -webkit-appearance: none;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  width: 100%;
  height: 40px;
  cursor: pointer;
}

.settings-panel input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.settings-panel input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Icon search results styles */
.icon-search-results {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  transition: all 0.2s;
}

.icon-option:hover {
  background-color: #f3f4f6;
  transform: scale(1.1);
}

/* Settings panel icon search */
.icon-search-input {
  transition: all 0.3s ease;
}

.icon-search-input:not(.hidden) {
  margin-left: 0.5rem;
}

.icon-search-btn {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Tab Styles */
.tab-btn {
  position: relative;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: #3b82f6;
}

.tab-btn:not(.active) {
  border-bottom: 2px solid transparent;
}

.tab-btn:hover:not(.active) {
  border-bottom: 2px solid #d3d3d3;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Additional responsive styles for tabs */
@media (max-width: 640px) {
  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .tab-btn i {
    margin-right: 0;
  }
  
  .tab-btn span {
    display: none;
  }
}

.image-container img {
  border-radius: 0;
}

.image-container {
  flex: 0 0 auto;
  margin: 0.5rem;
  max-width: calc(33.333% - 1rem);
  min-width: calc(30% - 1rem);
  transition: all 0.3s ease;
}

.image-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.image-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -0.5rem;
  width: 100%;
}

@media (max-width: 768px) {
  .image-container {
    max-width: calc(50% - 1rem); /* Allow up to 2 images per row on smaller screens */
  }
}

@media (max-width: 480px) {
  .image-container {
    max-width: calc(100% - 1rem); /* Single column on very small screens */
  }
}

/* Responsive adjustments */
@media (max-width: 1023px) {
  .container {
    max-width: 100%;
    padding-right: 1rem !important;
  }
}