/* Email Page Specific Styles */

/* Email page card - larger to fit laptop, more space for text */
.card.email-card {
  max-width: 1600px;
  overflow: hidden;
  width: 100%;
}

.card.email-card::before {
  inset: -160px;
}

/* Email page content - more breathing room */
.card.email-card .content {
  padding-right: 32px;
  min-width: 0;
}

/* Email page art - align to left within its column */
.card.email-card .art {
  justify-self: start;
  box-sizing: border-box;
}

.card.email-card h1 {
  font-size: clamp(2.8rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin-top: 22px;
  margin-bottom: 18px;
}

.card.email-card h1 br {
  display: none;
}

.card.email-card .subhead {
  font-size: 1.15rem;
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 100%;
}

.card.email-card .alert-box {
  padding: 18px 20px 20px;
  margin-bottom: 28px;
}

.card.email-card .alert-text-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.card.email-card .alert-text-body {
  font-size: 0.9rem;
  line-height: 1.6;
}

.card.email-card .steps {
  margin-top: 20px;
}

.card.email-card .steps-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.card.email-card .steps-list {
  gap: 14px;
  font-size: 1.05rem;
}

.card.email-card .step {
  gap: 14px;
}

.card.email-card .step-index {
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  margin-top: 4px;
}

.card.email-card .step span {
  line-height: 1.7;
}

.card.email-card .qr-section {
  margin-top: 28px;
  padding: 20px 20px 22px;
}

.card.email-card .qr-header {
  margin-bottom: 12px;
}

.card.email-card .qr-title {
  font-size: 1rem;
}

.card.email-card .qr-body {
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

.card.email-card .qr-list {
  gap: 12px;
  font-size: 0.92rem;
}

.card.email-card .qr-item {
  gap: 10px;
  line-height: 1.6;
}

.card.email-card .tiny-note {
  font-size: 0.85rem;
  margin-top: 16px;
  line-height: 1.6;
}

/* Email page specific art container */
.art-inner.email-art {
  max-width: 480px;
  min-height: 380px;
  height: 380px;
  width: 100%;
}

@media (min-width: 1200px) {
  .card.email-card .card-body {
    gap: 64px;
  }
  
  .card.email-card .content {
    padding-right: 48px;
  }
  
  .card.email-card .art {
    justify-self: start;
    box-sizing: border-box;
  }
  
  .card.email-card .step span {
    line-height: 1.75;
  }
  
  .art-inner.email-art {
    max-width: 460px;
    min-height: 360px;
    height: 360px;
  }
  
  .laptop-device {
    width: 420px;
    height: 300px;
  }
}

@media (max-width: 1200px) and (min-width: 901px) {
  .card.email-card .content-with-art {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 36px;
  }
  
  .card.email-card .content {
    padding-right: 20px;
  }
  
  .card.email-card .art {
    justify-self: start;
    box-sizing: border-box;
  }
}

@media (max-width: 900px) {
  .card.email-card {
    grid-template-columns: 1fr;
    padding: 24px 0 0;
    gap: 0;
  }
  
  .card.email-card .card-header {
    padding: 0 20px 24px 20px;
  }
  
  .card.email-card h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    text-align: center;
    letter-spacing: -0.02em;
  }
  
  .card.email-card h1 br {
    display: block;
  }
  
  .card.email-card .card-body {
    padding: 28px 20px 24px 20px;
  }
  
  .card.email-card .content {
    padding-right: 0;
  }
  
  .card.email-card .art {
    margin-right: 0;
    margin-top: 32px;
  }
  
  .art-inner.email-art {
    max-width: 100%;
    min-height: 360px;
    height: 360px;
  }
  
  .laptop-device {
    width: 100%;
    max-width: 380px;
    height: 280px;
  }
}

@media (max-width: 700px) {
  .card.email-card .card-header {
    padding: 0 16px 20px 16px;
  }
  
  .card.email-card h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    text-align: center;
    letter-spacing: -0.02em;
  }
  
  .card.email-card h1 br {
    display: block;
  }
  
  .card.email-card .card-body {
    padding: 24px 16px 20px 16px;
  }
  
  .art-inner.email-art {
    min-height: 320px;
    height: 320px;
  }
  
  .laptop-device {
    max-width: 340px;
    height: 250px;
  }
}

@media (max-width: 700px) {
  .art-inner.email-art {
    min-height: 320px;
    height: 320px;
  }
  
  .laptop-device {
    width: 360px;
    height: 260px;
  }
  
  .laptop-screen-frame {
    padding: 6px;
  }
}

/* Laptop device - realistic frame */
.laptop-device {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 340px;
  z-index: 5;
  transition: all 0.5s ease;
}

/* Laptop base (bottom part) */
.laptop-base {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #374151, #1f2937);
  border-radius: 0 0 10px 10px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}

.laptop-base::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 3px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0 0 2px 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Laptop screen frame */
.laptop-screen-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 20px;
  background: linear-gradient(135deg, #374151, #1f2937);
  border-radius: 14px 14px 6px 6px;
  padding: 10px;
  box-shadow: 
    0 25px 70px rgba(15, 23, 42, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.laptop-screen-frame::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 5px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.laptop-screen-frame::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(34, 197, 94, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.laptop-screen {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.laptop-screen.hacked {
  background: rgba(239, 68, 68, 0.1);
  border: 3px solid rgba(239, 68, 68, 0.6);
}

.laptop-screen.hacked::before {
  content: "⚠";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  color: rgba(239, 68, 68, 0.8);
  animation: hack-warning 1s ease-in-out infinite;
  z-index: 10;
}

.laptop-screen.hacked::after {
  content: "HACKED";
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  z-index: 10;
  animation: hack-text 1s ease-in-out infinite;
}

.laptop-keyboard {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #374151, #1f2937);
  border-radius: 0 0 10px 10px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.laptop-keyboard::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 2px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.3);
}

/* Outlook ribbon */
.email-ribbon {
  height: 60px;
  background: #f3f2f1;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.ribbon-button {
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #323130;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease;
}

.ribbon-button:hover {
  background: #edebe9;
}

.ribbon-button.active {
  background: #deecf9;
  color: #0078d4;
}

.email-sidebar {
  width: 200px;
  background: #faf9f8;
  border-right: 1px solid #e1dfdd;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.email-sidebar-item {
  height: 36px;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.75rem;
  color: #323130;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 400;
}

.email-sidebar-item:hover {
  background: #edebe9;
}

.email-sidebar-item.active {
  background: #deecf9;
  color: #0078d4;
  font-weight: 600;
}

.email-sidebar-item::before {
  content: "📧";
  margin-right: 8px;
  font-size: 0.9rem;
}

.email-content {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.email-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #e1dfdd;
}

.email-list-header {
  height: 32px;
  background: #faf9f8;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #605e5c;
  gap: 12px;
}

.email-list-header-item {
  flex: 1;
}

.email-list-header-item:nth-child(1) {
  flex: 0 0 200px;
}

.email-item {
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e1dfdd;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: email-appear 0.5s ease-in;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.email-item:hover {
  background: #f3f2f1;
}

.email-item.selected {
  background: #deecf9;
  border-left-color: #0078d4;
}

.email-item.suspicious {
  background: #fff4f4;
  border-left-color: #d13438;
}

.email-item.suspicious:hover {
  background: #ffeaea;
}

.email-item.suspicious.selected {
  background: #ffeaea;
  border-left-color: #d13438;
  box-shadow: inset 0 0 0 1px rgba(209, 52, 56, 0.2);
}

.email-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.email-sender {
  font-weight: 600;
  font-size: 0.75rem;
  color: #323130;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-sender.suspicious {
  color: #d13438;
}

.email-subject {
  font-size: 0.75rem;
  color: #605e5c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.email-subject.suspicious {
  color: #d13438;
  font-weight: 600;
}

.email-preview {
  font-size: 0.7rem;
  color: #8a8886;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-preview.suspicious {
  color: #d13438;
}

.email-time {
  font-size: 0.7rem;
  color: #8a8886;
  flex-shrink: 0;
  width: 60px;
  text-align: right;
}

/* Email detail view */
.email-detail {
  display: none;
  flex-direction: column;
  padding: 16px 20px;
  overflow-y: auto;
}

.email-detail.active {
  display: flex;
  animation: email-detail-appear 0.5s ease-in;
}

.email-detail-header {
  padding-bottom: 16px;
  border-bottom: 1px solid #e1dfdd;
  margin-bottom: 16px;
}

.email-detail-from {
  font-size: 0.8rem;
  color: #605e5c;
  margin-bottom: 8px;
}

.email-detail-from.suspicious {
  color: #d13438;
  font-weight: 600;
}

.email-detail-subject {
  font-size: 1.1rem;
  font-weight: 600;
  color: #323130;
  margin-bottom: 12px;
}

.email-detail-subject.suspicious {
  color: #d13438;
}

.email-detail-body {
  font-size: 0.85rem;
  color: #323130;
  line-height: 1.6;
  margin-bottom: 20px;
}

.email-detail-link {
  display: inline-block;
  padding: 10px 24px;
  background: #0078d4;
  color: #ffffff;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: link-pulse 2s ease-in-out infinite;
  border: none;
}

.email-detail-link:hover {
  background: #106ebe;
  box-shadow: 0 2px 4px rgba(0, 120, 212, 0.3);
}

.email-detail-link.clicked {
  animation: link-clicked 0.5s ease-in;
  background: #107c10;
}

/* Mouse cursor - using cursor.svg */
.mouse-cursor {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 100;
  transform-origin: 5px 5px;
  top: 0;
  left: 0;
  will-change: transform;
  background-image: url("../images/cursor.svg");
  background-size: 24px 24px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));
}

.mouse-cursor.clicking {
  transform: scale(0.9) translate(1px, 1px);
  filter: drop-shadow(0 0 1px rgba(0, 120, 212, 0.5)) hue-rotate(200deg) saturate(1.5);
}

/* Hack particles */
.hack-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
}

.hack-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ef4444;
  border-radius: 50%;
  animation: particle-float 2s ease-out infinite;
}

/* Animation states */
.laptop-device.state-open-email {
  animation: laptop-open-email 2s ease-in-out;
}

.laptop-device.state-click-link {
  animation: laptop-click-link 1.5s ease-in-out;
}

.laptop-device.state-hacked {
  animation: laptop-hacked 3s ease-in-out;
  filter: brightness(0.7) hue-rotate(10deg);
}

/* Animations */
@keyframes email-appear {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes email-detail-appear {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes link-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(14, 165, 233, 0);
  }
  50% {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
  }
}

@keyframes link-clicked {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes laptop-open-email {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.02);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes laptop-click-link {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes laptop-hacked {
  0% {
    filter: brightness(1) hue-rotate(0deg);
  }
  50% {
    filter: brightness(0.8) hue-rotate(5deg);
  }
  100% {
    filter: brightness(0.7) hue-rotate(10deg);
  }
}

@keyframes hack-warning {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    opacity: 1;
  }
}

@keyframes hack-text {
  0%, 100% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
  }
}

@keyframes particle-float {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(var(--particle-x, 0));
  }
}
