/**
 * RedMail Pro - Glassmorphism Styles
 * Glass morphism effects for all components
 */

/* ===================================
   GLASS CARDS
   =================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.glass-card-small {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: var(--spacing-sm);
}

/* ===================================
   GLASS HEADER & SIDEBAR
   =================================== */
.glass-header {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.glass-sidebar {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
}

.glass-footer {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   GLASS NAV ITEMS
   =================================== */
.glass-nav-item {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.glass-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.glass-nav-item.active {
  background: rgba(229, 62, 62, 0.15);
  border-color: rgba(229, 62, 62, 0.3);
  box-shadow: 0 0 20px rgba(229, 62, 62, 0.3);
}

/* ===================================
   GLASS BUTTONS
   =================================== */
.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(255, 255, 255, 0.1);
}

.btn-glass:active {
  transform: translateY(0);
}

.btn-glass svg {
  width: 18px;
  height: 18px;
}

/* ===================================
   GLASS BUTTON VARIANTS
   =================================== */
.btn-glass-primary {
  background: rgba(229, 62, 62, 0.2);
  border-color: rgba(229, 62, 62, 0.5);
  color: var(--color-text-primary);
}

.btn-glass-primary:hover {
  background: rgba(229, 62, 62, 0.3);
  border-color: rgba(229, 62, 62, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(229, 62, 62, 0.5);
}

.btn-glass-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-glass-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-glass-success {
  background: rgba(72, 187, 120, 0.2);
  border-color: rgba(72, 187, 120, 0.5);
}

.btn-glass-success:hover {
  background: rgba(72, 187, 120, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(72, 187, 120, 0.5);
}

.btn-glass-danger {
  background: rgba(252, 129, 129, 0.2);
  border-color: rgba(252, 129, 129, 0.5);
}

.btn-glass-danger:hover {
  background: rgba(252, 129, 129, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(252, 129, 129, 0.5);
}

.btn-glass-warning {
  background: rgba(237, 137, 54, 0.2);
  border-color: rgba(237, 137, 54, 0.5);
}

.btn-glass-warning:hover {
  background: rgba(237, 137, 54, 0.3);
  border-color: rgba(237, 137, 54, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(237, 137, 54, 0.5);
}

.btn-glass-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-glass-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ===================================
   GLASS INPUTS
   =================================== */
.glass-input {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  color: var(--color-text-primary) !important;
}

.glass-input:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(229, 62, 62, 0.5) !important;
  box-shadow: 0 0 20px rgba(229, 62, 62, 0.3);
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* ===================================
   GLASS SELECT
   =================================== */
select.glass-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ===================================
   GLASS TEXTAREA
   =================================== */
textarea.glass-input {
  resize: vertical;
  min-height: 120px;
}

/* ===================================
   GLASS CHECKBOX & RADIO
   =================================== */
.glass-checkbox,
.glass-radio {
  appearance: none;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.glass-radio {
  border-radius: 50%;
}

.glass-checkbox:checked,
.glass-radio:checked {
  background: rgba(229, 62, 62, 0.3);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

.glass-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: var(--color-text-primary);
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.glass-radio:checked::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent-primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(229, 62, 62, 0.8);
}

/* ===================================
   GLASS TABLE
   =================================== */
.glass-table {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.glass-table thead {
  background: rgba(255, 255, 255, 0.05);
}

.glass-table tbody tr {
  transition: all 0.3s ease;
}

.glass-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(229, 62, 62, 0.1);
}

/* ===================================
   GLASS BADGE
   =================================== */
.badge-glass {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(229, 62, 62, 0.2);
  border-color: rgba(229, 62, 62, 0.4);
  color: var(--color-accent-light);
}

.badge-success {
  background: rgba(72, 187, 120, 0.2);
  border-color: rgba(72, 187, 120, 0.4);
  color: #68d391;
}

.badge-warning {
  background: rgba(237, 137, 54, 0.2);
  border-color: rgba(237, 137, 54, 0.4);
  color: #f6ad55;
}

.badge-info {
  background: rgba(66, 153, 225, 0.2);
  border-color: rgba(66, 153, 225, 0.4);
  color: #63b3ed;
}

.badge-danger {
  background: rgba(252, 129, 129, 0.2);
  border-color: rgba(252, 129, 129, 0.4);
  color: var(--color-error);
}

/* ===================================
   GLASS PROGRESS BAR
   =================================== */
.progress-glass {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg,
    rgba(229, 62, 62, 0.6),
    rgba(229, 62, 62, 0.8),
    rgba(229, 62, 62, 1)
  );
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 20px rgba(229, 62, 62, 0.6);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ===================================
   GLASS TOOLTIP
   =================================== */
.tooltip-glass {
  position: relative;
}

.tooltip-glass::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.tooltip-glass:hover::after {
  opacity: 1;
}

/* ===================================
   GLASS MODAL
   =================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-glass {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: var(--spacing-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* ===================================
   GLASS ANIMATIONS
   =================================== */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(229, 62, 62, 0.8);
  }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes fade-in-glass {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-glass {
  animation: fade-in-glass 0.5s ease;
}
