/**
 * Surely - Main Stylesheet - Mobile Optimized
 * Matching reference design with mobile-first approach
 */

/* ============================
   RESET & BASE STYLES
   ============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================
   HEADER NAVIGATION
   ============================ */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(165, 29, 42, 0.95);
  padding: 1rem 2rem;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #a51d2a;
  flex-shrink: 0;
}

.logo-img {
  height: 50px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  opacity: 0.9;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.auth-buttons,
.user-menu {
  display: flex;
  align-items: center;
}

.download-btn {
  background: transparent;
  border: 2px solid white;
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s;
  text-decoration: none;
  white-space: nowrap;
}

.download-btn:hover {
  background: white;
  color: #a51d2a;
}

/* ============================
   CONTAINER
   ============================ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* ============================
   SECTION HEADER
   ============================ */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #333;
  text-transform: uppercase;
  font-weight: 700;
}

.section-header p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #000;
  color: white;
  padding: 1.2rem 2.5rem;
  border-radius: 8px;
  font-size: 1.1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #a51d2a;
}

.btn-outline {
  background: transparent;
  color: #a51d2a;
  border: 2px solid #a51d2a;
}

.btn-outline:hover {
  background: #a51d2a;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ============================
   CODE CARDS
   ============================ */
.code-card {
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: all 0.3s;
}

.code-card:hover {
  border-color: #a51d2a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.codes-grid {
  display: grid;
  gap: 1.5rem;
}

/* ============================
   LOADING STATES
   ============================ */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #E0E0E0;
  border-top-color: #a51d2a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================
   ALERTS
   ============================ */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4CAF50;
  color: #4CAF50;
}

.alert-error {
  background: rgba(255, 23, 68, 0.1);
  border-color: #FF1744;
  color: #FF1744;
}

.alert-warning {
  background: rgba(255, 215, 0, 0.1);
  border-color: #FFD700;
  color: #b8860b;
}

.alert-info {
  background: rgba(0, 184, 255, 0.1);
  border-color: #00B8FF;
  color: #00B8FF;
}

/* ============================
   UTILITY CLASSES
   ============================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-primary {
  color: #a51d2a;
}

.text-secondary {
  color: #666;
}

/* ============================
   MOBILE RESPONSIVE DESIGN
   ============================ */
@media (max-width: 968px) {
  /* Header */
  header {
    padding: 1rem;
  }
  
  nav {
    padding: 0;
  }
  
  .logo-img {
    height: 40px;
    max-width: 120px;
  }
  
  /* Container */
  .container {
    padding: 0 1rem;
  }
  
  /* Section Headers */
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .section-header p {
    font-size: 1rem;
  }
  
  /* Buttons */
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
  
  .btn-primary {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  /* Header */
  header {
    padding: 0.75rem;
  }
  
  .logo-img {
    height: 35px;
    max-width: 100px;
  }
  
  /* Container */
  .container {
    padding: 0 1rem;
  }
  
  /* Section Headers */
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .section-header p {
    font-size: 0.95rem;
  }
  
  /* Buttons */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .btn-primary {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Prevent any element from causing horizontal scroll */
* {
  max-width: 100%;
}

section {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Ensure images don't overflow */
img {
  max-width: 100%;
  height: auto;
}