/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Component-specific stylesheets are loaded individually in layouts */

/* Global Cosmic Theme Variables */
:root {
  --cosmic-deep: #1a1a2e;
  --cosmic-dark: #16213e;
  --cosmic-blue: #0f3460;
  --cosmic-purple: #533483;
  --cosmic-red: #e94560;
  --cosmic-gold: #ffd700;
  --cosmic-white: #ffffff;
  --cosmic-light: #f8f9fa;
  --cosmic-gray: #6c757d;
  --cosmic-shadow: rgba(0, 0, 0, 0.3);
  --cosmic-glow: rgba(255, 215, 0, 0.3);
}

/* Flash Messages - Floating Overlay */
.flash-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 20px;
  max-width: 500px;
  width: 90%;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  transition: all 0.3s ease;
}

.flash-message.notice {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-message.alert {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-content {
  flex: 1;
}

.flash-dismiss {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.flash-dismiss:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Global Styles */
body {
  background: linear-gradient(135deg, var(--cosmic-deep) 0%, var(--cosmic-dark) 25%, var(--cosmic-blue) 50%, var(--cosmic-purple) 75%, var(--cosmic-red) 100%);
  background-attachment: fixed;
  color: var(--cosmic-white);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
}

/* Loading States */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--cosmic-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1 0 auto;
  padding-bottom: 20px;
}

/* Cosmic Button Styles */
.btn {
  background: linear-gradient(135deg, var(--cosmic-purple), var(--cosmic-red));
  color: var(--cosmic-white);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(83, 52, 131, 0.3);
}

.btn:hover {
  background: linear-gradient(135deg, var(--cosmic-red), var(--cosmic-purple));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(83, 52, 131, 0.5);
  color: var(--cosmic-white);
  text-decoration: none;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--cosmic-blue), var(--cosmic-purple));
  box-shadow: 0 4px 12px rgba(15, 52, 96, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--cosmic-purple), var(--cosmic-blue));
  box-shadow: 0 6px 20px rgba(15, 52, 96, 0.5);
}

/* Cosmic Card Styles */
.card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 215, 0, 0.3);
}

/* Cosmic Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--cosmic-white);
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.form-control:focus {
  outline: none;
  border-color: var(--cosmic-gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Cosmic Alert Styles */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid;
}

.alert-success {
  background: rgba(40, 167, 69, 0.2);
  border-color: rgba(40, 167, 69, 0.5);
  color: #98d8aa;
}

.alert-error, .alert-danger {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.5);
  color: #f8a5a5;
}

.alert-info {
  background: rgba(23, 162, 184, 0.2);
  border-color: rgba(23, 162, 184, 0.5);
  color: #a5d8f8;
}

.alert-warning {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.5);
  color: #f8e5a5;
}

/* Cosmic Blog Index Styles */
.blog-index-cosmic {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: linear-gradient(135deg, #1a1a40 0%, #23235b 100%);
  border-radius: 1.5rem;
  box-shadow: 0 4px 32px 0 #000a, 0 1.5px 0 #fff2 inset;
}
.blog-index-title {
  color: #fff;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px #0008, 0 0 1px #fff8;
}
.blog-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.blog-card {
  background: rgba(30, 30, 60, 0.95);
  border-radius: 1rem;
  box-shadow: 0 2px 16px 0 #0006, 0 1px 0 #fff1 inset;
  padding: 1.5rem 2rem;
  min-width: 220px;
  max-width: 320px;
  flex: 1 1 220px;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1.5px solid #3a3a6a;
}
.blog-card:hover {
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
  box-shadow: 0 8px 32px 0 #2e2e6a99, 0 2px 0 #fff2 inset;
  border-color: #7f5fff;
}
.blog-card-header {
  margin-bottom: 1rem;
}
.blog-card-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: block;
}
.blog-card-languages {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.language-link {
  color: #7f5fff;
  font-size: 0.9rem;
  font-weight: 500;
  background: #23235b;
  border-radius: 0.5rem;
  padding: 0.3em 0.8em;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid #3a3a6a;
}
.language-link:hover {
  color: #fff;
  background: #7f5fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px 0 #7f5fff66;
}

.blog-disabled-message {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(30, 30, 60, 0.95);
  border-radius: 1rem;
  border: 1.5px solid #3a3a6a;
  margin-top: 2rem;
}

.blog-disabled-message p {
  color: #e8e8ff;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px #0004;
}

.blog-disabled-message p:first-child {
  color: #7f5fff;
  font-size: 1.4rem;
  font-weight: 600;
  text-shadow: 0 1px 4px #7f5fff44;
}

/* Cosmic Blog Footer Link */
.footer-link-cosmic {
  color: #7f5fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px #7f5fff44;
  transition: color 0.15s;
}
.footer-link-cosmic:hover {
  color: #fff;
  text-decoration: underline wavy #7f5fff;
}

/* Cosmic Blog Post Styles */
.blog-post {
  max-width: 800px;
  margin: 2rem auto;
  padding: 3rem;
  background: linear-gradient(135deg, #1a1a40 0%, #23235b 100%);
  border-radius: 1.5rem;
  box-shadow: 0 4px 32px 0 #000a, 0 1.5px 0 #fff2 inset;
  color: #fff;
  line-height: 1.7;
}
.blog-post h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 0 2px 8px #0008, 0 0 1px #fff8;
  letter-spacing: 0.02em;
  text-align: center;
}
.blog-post .post-meta {
  text-align: center;
  color: #7f5fff;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px #7f5fff44;
}
.blog-post .post-content {
  font-size: 1.1rem;
  color: #e8e8ff;
}
.blog-post .post-content p {
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 2px #0004;
}
.blog-post .post-content ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
}
.blog-post .post-content li {
  margin-bottom: 0.5rem;
  color: #f0f0ff;
  text-shadow: 0 1px 2px #0004;
}
.blog-post .post-content strong {
  color: #7f5fff;
  font-weight: 600;
  text-shadow: 0 1px 4px #7f5fff44;
}


.success-container {
  max-width: 600px;
  width: 100%;
  background: rgba(30, 30, 60, 0.95);
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: 0 8px 32px 0 #000a, 0 2px 0 #fff2 inset;
  border: 1.5px solid #3a3a6a;
  text-align: center;
}
.success-title {
  color: #fff;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px #0008, 0 0 1px #fff8;
}
.success-message {
  color: #e8e8ff;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.success-details {
  color: #e8e8ff;
  margin-bottom: 2.5rem;
}
.success-details ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}
.success-details li {
  margin-bottom: 0.5rem;
}
.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.success-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #7f5fff 0%, #9f7fff 100%);
  color: #fff;
  border: none;
  border-radius: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.success-button.secondary {
  background: rgba(60, 60, 100, 0.8);
  border: 1.5px solid #3a3a6a;
}
.success-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px 0 #7f5fff66;
}

/* Error Messages */
.error-messages {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid #ff6666;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #ffcccc;
}
.error-messages ul {
  margin: 0;
  padding-left: 1.5rem;
}
.error-messages li {
  margin-bottom: 0.25rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: linear-gradient(135deg, var(--cosmic-deep) 0%, var(--cosmic-dark) 100%);
  border: 2px solid var(--cosmic-purple);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--cosmic-gold);
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--cosmic-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cosmic-red);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.blocking-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cosmic-white);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.blocking-select:focus {
  outline: none;
  border-color: var(--cosmic-purple);
  box-shadow: 0 0 0 2px rgba(83, 52, 131, 0.3);
}

.warning {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffd54f;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.error-message {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #ff8a80;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.btn-warning {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ff5722, #ff9800);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

/* Project Completion Components */
.project-completion-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.banner-message {
  flex: 1;
  min-width: 300px;
}

.banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-completion-prompt {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.prompt-content {
  max-width: 600px;
  margin: 0 auto;
}

.prompt-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.prompt-message {
  margin-bottom: 1.5rem;
  line-height: 1.5;
  color: #2c3e50;
}

.prompt-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .banner-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .banner-message {
    min-width: auto;
    text-align: center;
  }
  
  .banner-actions {
    justify-content: center;
  }
  
  .prompt-actions {
    flex-direction: column;
    align-items: center;
  }
}
