/* Consolidated CSS */
:root {
  --primary-color: #e91e63;
  --secondary-color: #4caf50;
  --accent-color: #ffeb3b;
  --text-color: #333;
  --light-bg: #d0c5e2;
  --card-shadow: 0 10px 25px rgba(0,0,0,0.3);
  --success-color: #4caf50;
  --error-color: #f44336;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.main-header {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.8;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main Content */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 20px;
}

/* Card Styles */
.card-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.flip-card {
  background-color: transparent;
  width: 100%;
  max-width: 500px;
  height: 600px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  box-shadow: var(--card-shadow);
  border-radius: 15px;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  box-sizing: border-box;
}

.flip-card-front {
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  color: #d32f2f;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  border: 5px solid var(--accent-color);
  overflow: hidden;
}

.flip-card-back {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
  color: var(--text-color);
  font-size: 1.3rem;
  line-height: 1.8;
  transform: rotateY(180deg);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
  border: 5px solid var(--secondary-color);
  overflow-y: auto;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  margin-bottom: 20px;
  background-color: #eee;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.social-icons a {
  color: var(--text-color);
  font-size: 24px;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.social-icons a:hover {
  transform: scale(1.2);
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.5);
}

.birthday-text {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  margin: 15px 0;
  text-align: center;
}

/* Editor Container */
.editor-container {
  max-width: 800px;
  margin: 0 auto;
}

.editor {
  padding: 2rem;
  background: white;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.editor h3 {
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  text-align: center;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.social-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

/* Button Styles */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 2rem;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
}

button.primary {
  background-color: var(--primary-color);
  color: white;
}

button.primary:hover {
  background-color: #d81b60;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

button.secondary {
  background-color: var(--secondary-color);
  color: white;
}

button.secondary:hover {
  background-color: #43a047;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

button.accent {
  background-color: var(--accent-color);
  color: var(--text-color);
}

button.accent:hover {
  background-color: #fdd835;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 235, 59, 0.3);
}

/* Upload Section */
.image-upload-section {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  text-align: center;
}

.upload-btn {
  background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  min-width: auto;
  display: inline-flex;
}

.upload-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(0, 176, 155, 0.4);
}

.upload-progress {
  margin-top: 1rem;
  padding: 1rem;
  display: none;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00b09b, #96c93d);
  width: 0%;
  transition: width 0.3s;
}

/* Emoji Section */
.emoji-section {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.emoji-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.emoji-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 1rem 0;
}

.emoji-option {
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.3s;
  user-select: none;
  background: #f5f5f5;
}

.emoji-option:hover {
  transform: scale(1.2);
  background: var(--light-bg);
}

.emoji-option.selected {
  border-color: var(--primary-color);
  background: var(--light-bg);
  transform: scale(1.1);
}

.selected-emojis {
  min-height: 50px;
  padding: 15px;
  background: var(--light-bg);
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Share Section */
.share-section {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  text-align: center;
}

.share-btn {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  min-width: auto;
  display: inline-flex;
}

.share-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(106, 17, 203, 0.4);
}

.generated-url {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #6a11cb;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.url-display {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.url-display input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  background: white;
  font-size: 0.9rem;
}

.url-display button {
  padding: 10px 20px;
  min-width: auto;
}

.copy-btn {
  background: var(--secondary-color);
  color: white;
}

.open-btn {
  background: var(--primary-color);
  color: white;
}

.url-note {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Confetti Styles */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #f00;
  opacity: 0.8;
  animation: fall 5s linear forwards;
  z-index: 1000;
  pointer-events: none;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Random Emoji Animation */
.random-emoji {
  position: fixed;
  font-size: 3rem;
  animation: floatEmoji 2s ease-out forwards;
  pointer-events: none;
  z-index: 1000;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

@keyframes floatEmoji {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  80% {
    opacity: 1;
    transform: translateY(-100px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-150px) scale(0.5);
  }
}

/* Footer Styles */
footer {
  background: linear-gradient(135deg, #434343 0%, #000000 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-text {
  margin-bottom: 1rem;
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-text p {
  margin: 5px 0;
}

/* Error State */
.error-message {
  color: var(--error-color);
  background-color: #ffebee;
  padding: 10px;
  border-radius: 4px;
  margin-top: 5px;
  font-size: 0.9rem;
  display: none;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.has-error {
  border-color: var(--error-color) !important;
}

/* Success Message */
.success-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--success-color);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateX(-50%) translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
  }
}

@keyframes slideOut {
  from { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
  }
  to { 
    opacity: 0; 
    transform: translateX(-50%) translateY(20px); 
  }
}

/* Loading State */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    flex-direction: column;
    padding: 1rem;
    gap: 15px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .flip-card {
    height: 500px;
  }
  
  .flip-card-front {
    font-size: 1.5rem;
    padding: 20px;
  }
  
  .flip-card-back {
    font-size: 1.1rem;
    padding: 20px;
  }
  
  .profile-image {
    width: 120px;
    height: 120px;
  }
  
  .birthday-text {
    font-size: 1.5rem;
  }
  
  .editor {
    padding: 1.5rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  button {
    width: 100%;
  }
  
  .social-inputs {
    grid-template-columns: 1fr;
  }
  
  .url-display {
    flex-direction: column;
  }
  
  .url-display input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .flip-card {
    height: 400px;
  }
  
  .flip-card-front {
    font-size: 1.2rem;
  }
  
  .flip-card-back {
    font-size: 1rem;
  }
  
  .profile-image {
    width: 100px;
    height: 100px;
  }
  
  .birthday-text {
    font-size: 1.3rem;
  }
  
  .emoji-option {
    font-size: 1.5rem;
    padding: 8px;
  }
  
  .selected-emojis {
    font-size: 1.2rem;
  }

}
