/* Modern Flash Messages - StudentFinds Design System */
/* Matches the clean, minimal aesthetic of the homepage */

:root {
  --flash-success: #10b981;
  --flash-error: #ef4444;
  --flash-warning: #f59e0b;
  --flash-info: #0593d4;
  --flash-bg: #ffffff;
  --flash-text: #0f172a;
  --flash-border-radius: 12px;
  --flash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Main flash message container */
.flashmessage {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 15px;
  line-height: 1.6;
  padding: 16px 50px 16px 20px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 20px auto;
  border-radius: var(--flash-border-radius);
  box-shadow: var(--flash-shadow);
  position: relative;
  color: var(--flash-text);
  background: var(--flash-bg);
  border: none;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: all 0.2s ease;
}

.flashmessage:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.flashmessage + .flashmessage,
.flashmessage + #flash_js + .flashmessage {
  margin-top: 12px;
}

/* Success messages (green) */
.flashmessage-ok {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
  border-left: 4px solid var(--flash-success);
  color: var(--flash-text);
}

.flashmessage-ok::before {
  content: '✓';
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--flash-success);
  color: white;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Error messages (red) */
.flashmessage-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%);
  border-left: 4px solid var(--flash-error);
  color: var(--flash-text);
}

.flashmessage-error::before {
  content: '✕';
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--flash-error);
  color: white;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Warning messages (orange) */
.flashmessage-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
  border-left: 4px solid var(--flash-warning);
  color: var(--flash-text);
}

.flashmessage-warning::before {
  content: '⚠';
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--flash-warning);
  color: white;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Info messages (blue) */
.flashmessage-info {
  background: linear-gradient(135deg, rgba(5, 147, 212, 0.08) 0%, rgba(5, 147, 212, 0.04) 100%);
  border-left: 4px solid var(--flash-info);
  color: var(--flash-text);
}

.flashmessage-info::before {
  content: 'i';
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--flash-info);
  color: white;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Close button */
.flashmessage .ico-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--flash-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  padding: 0;
  margin: 0;
  text-shadow: none;
}

.flashmessage .ico-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-50%) scale(1.05);
}

.flashmessage .ico-close:active {
  transform: translateY(-50%) scale(0.95);
}

/* Links in flash messages */
.flashmessage a {
  color: var(--flash-info);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.15s ease;
}

.flashmessage a:hover {
  color: #0472a8;
}

/* Wrapper adjustments */
.wrapper-flash {
  margin-bottom: 20px;
  font-weight: normal;
}

.wrapper-flash.flash2 {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .flashmessage {
    font-size: 14px;
    padding: 14px 45px 14px 16px;
    border-radius: 10px;
  }
  
  .flashmessage::before {
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    margin-right: 10px;
  }
  
  .flashmessage .ico-close {
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 14px;
    right: 8px;
  }
}

/* Animation for new messages */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flashmessage {
  animation: slideInDown 0.3s ease-out;
}

/* Dark mode support (if needed) */
body.dark-mode .flashmessage {
  background: #1f2b3f;
  color: #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

body.dark-mode .flashmessage .ico-close {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

body.dark-mode .flashmessage .ico-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .flashmessage a {
  color: #60a5fa;
}

body.dark-mode .flashmessage a:hover {
  color: #93c5fd;
}

