@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Lora:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;600&display=swap');

:root {
  --primary: #2a1810;
  --secondary: #d4af37;
  --background: #121212; /* Dark theme for premium look */
  --surface: #1e1e1e;
  --text: #ffffff;
  --text-muted: #b0b0b0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--background);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
}

header {
  background: linear-gradient(to bottom, rgba(18,18,18,1) 0%, rgba(18,18,18,0.8) 100%);
  padding: 15px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.back-btn {
  position: absolute;
  left: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--secondary);
  cursor: pointer;
  display: none;
  padding: 5px;
  transition: transform 0.2s;
}

.back-btn:active {
  transform: translateX(-5px);
}

.logo-img {
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  width: 40px;
  margin-right: 12px;
  border: 1px solid var(--secondary);
}

header h1 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--secondary);
  letter-spacing: 1px;
}

.view {
  display: none;
  padding: 20px;
  animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 1000px;
  margin: 0 auto;
  min-height: calc(100vh - 70px);
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

/* Premium Card Design */
.card {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 4 / 5;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.card:active {
  transform: scale(0.97);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 15px;
  pointer-events: none;
}

.card-title {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-subtitle {
  font-size: 11px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* Inside Module View */
.module-header {
  margin-bottom: 30px;
  text-align: center;
}

.module-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: var(--secondary);
  margin-bottom: 10px;
}

.module-header p {
  font-family: 'Lora', serif;
  color: var(--text-muted);
  font-style: italic;
}

.item-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  list-style: none;
}

@media (min-width: 600px) {
  .item-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sub-item Card Design */
.item-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

@media (max-width: 400px) {
  .item-card {
     aspect-ratio: 4 / 3;
  }
}

.item-card:active {
  transform: scale(0.98);
}

.item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.item-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.item-icon {
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--secondary);
}

.item-title {
  font-family: 'Lora', serif;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
  line-height: 1.4;
}

/* Install Container */
.install-container {
  text-align: center;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0,0,0,0.3) 100%);
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.install-container h3 {
  font-family: 'Cinzel', serif;
  color: var(--secondary);
  margin-bottom: 8px;
  font-size: 18px;
}

.install-container p {
  color: #e0e0e0;
  font-size: 14px;
  margin-bottom: 15px;
}

.btn {
  background: linear-gradient(135deg, #d4af37 0%, #aa8822 100%);
  color: #121212;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.96);
}

/* iOS Instructions */
.ios-instructions {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 25px 20px 45px 20px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  z-index: 1000;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.ios-instructions.active {
  display: block;
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.close-ios {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.ios-instructions h3 {
  font-family: 'Cinzel', serif;
  color: var(--secondary);
  margin-bottom: 15px;
}

.ios-instructions p {
  color: var(--text);
  margin-bottom: 10px;
  font-size: 15px;
}

/* PDF View */
.pdf-header {
  text-align: center;
  margin-bottom: 20px;
}

.pdf-header h3 {
  font-family: 'Lora', serif;
  color: #fff;
  font-size: 20px;
  margin-bottom: 15px;
}

.pdf-container {
  height: calc(100vh - 220px);
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
