/**
 * MAKTOUB Layout Styles
 * Version: 1.0.0
 * Author: WEBDEV
 *
 * Contents:
 * 1. Page Layouts
 * 2. Auth Layout (Split-screen)
 * 3. Account Layout (Sidebar)
 * 4. Marketing Layout
 * 5. Payment Flow Layout
 */

/* ========================================
 * 1. PAGE LAYOUTS
 * ======================================== */

/* Main app wrapper */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main content area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Page wrapper with padding */
.page {
  flex: 1;
  padding: var(--space-lg) 0;
}

@media (min-width: 768px) {
  .page {
    padding: var(--space-xl) 0;
  }
}

@media (min-width: 1024px) {
  .page {
    padding: var(--space-2xl) 0;
  }
}

/* Full height page (for auth, etc) */
.page-full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Centered content page */
.page-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-lg);
}

/* ========================================
 * 2. AUTH LAYOUT (Split-screen)
 * Login / Signup pages
 * ======================================== */

.auth-layout {
  display: flex;
  min-height: 100vh;
}

/* Left side - Form */
.auth-form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl);
  background-color: var(--white);
}

@media (min-width: 768px) {
  .auth-form-section {
    padding: var(--space-2xl);
  }
}

@media (min-width: 1024px) {
  .auth-form-section {
    padding: var(--space-3xl);
    max-width: 50%;
  }
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.auth-header {
  margin-bottom: var(--space-2xl);
}

.auth-header .logo {
  margin-bottom: var(--space-xl);
}

.auth-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--text-light);
}

.auth-form {
  margin-bottom: var(--space-xl);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.auth-social-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-footer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-light);
}

.auth-footer a {
  color: var(--brand);
  font-weight: var(--font-medium);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Right side - Visual */
.auth-visual-section {
  display: none;
  flex: 1;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .auth-visual-section {
    display: flex;
    align-items: flex-end;       /* caption sits at the bottom */
    justify-content: center;
    padding: 0;                  /* image covers the full panel */
  }
}

/* The uploaded image (or fallback) fills the entire left panel */
.auth-visual-image {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
}

.auth-visual-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Caption overlaid on the image with a gradient scrim for legibility */
.auth-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: none;
  padding: var(--space-3xl) var(--space-2xl) var(--space-2xl);
  background: linear-gradient(to top, rgba(30, 14, 8, 0.65) 0%, rgba(30, 14, 8, 0.25) 50%, transparent 100%);
}

.auth-visual-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: #fff;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.auth-visual-description {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.92);
  line-height: var(--leading-relaxed);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* Decorative blobs removed — the image now fills the panel. */

/* ========================================
 * 3. ACCOUNT LAYOUT (Sidebar)
 * Dashboard, Settings pages
 * ======================================== */

.account-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
}

@media (min-width: 1024px) {
  .account-layout {
    flex-direction: row;
    gap: var(--space-xl);
    padding: var(--space-xl);
    max-width: var(--max-width-wide);
    margin: 0 auto;
    width: 100%;
  }
}

/* Sidebar */
.account-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .account-sidebar {
    display: block;
    width: var(--sidebar-width);
    flex-shrink: 0;
  }
}

/* Main content */
.account-content {
  flex: 1;
  padding: var(--space-lg);
  min-width: 0; /* Prevent flex overflow */
}

@media (min-width: 768px) {
  .account-content {
    padding: var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .account-content {
    padding: 0;
  }
}

/* Account page header */
.account-page-header {
  margin-bottom: var(--space-xl);
}

.account-page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-xs);
}

@media (min-width: 768px) {
  .account-page-title {
    font-size: var(--text-3xl);
  }
}

.account-page-subtitle {
  font-size: var(--text-base);
  color: var(--text-light);
}

/* Account card sections */
.account-section {
  margin-bottom: var(--space-xl);
}

.account-section:last-child {
  margin-bottom: 0;
}

.account-section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-md);
}

/* ========================================
 * 4. MARKETING LAYOUT
 * Landing page sections
 * ======================================== */

/* Hero section */
.hero {
  padding: var(--space-3xl) 0;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    padding: var(--space-4xl) 0;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: var(--space-5xl) 0;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--text);
  margin-bottom: var(--space-lg);
  line-height: var(--leading-tight);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: var(--text-5xl);
  }
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-light);
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .hero-description {
    font-size: var(--text-xl);
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* Marketing sections */
.section {
  padding: var(--space-3xl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-4xl) 0;
  }
}

.section-alt {
  background-color: var(--white);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: var(--space-3xl);
  }
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-3xl);
  }
}

.section-description {
  font-size: var(--text-base);
  color: var(--text-light);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .section-description {
    font-size: var(--text-lg);
  }
}

/* Feature grid */
.feature-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

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

.feature-card {
  text-align: center;
  padding: var(--space-xl);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  background-color: var(--brand-light);
  border-radius: var(--radius-lg);
  color: var(--brand);
}

.feature-icon svg {
  width: 32px;
  height: 32px;
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.feature-description {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: var(--leading-relaxed);
}

/* Pricing grid */
.pricing-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
  }
}

/* Footer */
.footer {
  background-color: var(--text);
  color: var(--white);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  margin-bottom: var(--space-lg);
}

.footer-logo img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.footer-description {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  line-height: var(--leading-relaxed);
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--white);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--white);
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background-color var(--transition-fast);
}

.footer-social-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.footer-social-link svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-copyright {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
}

/* ========================================
 * 5. PAYMENT FLOW LAYOUT
 * Multi-step payment process
 * ======================================== */

.payment-layout {
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-gradient);
  padding: var(--space-xl) 0;
}

@media (min-width: 768px) {
  .payment-layout {
    padding: var(--space-2xl) 0;
  }
}

.payment-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Payment stepper */
.payment-stepper {
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .payment-stepper {
    margin-bottom: var(--space-3xl);
  }
}

/* Payment card */
.payment-card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .payment-card {
    padding: var(--space-2xl);
  }
}

.payment-card-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.payment-card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-xs);
}

@media (min-width: 768px) {
  .payment-card-title {
    font-size: var(--text-2xl);
  }
}

.payment-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-light);
}

.payment-card-body {
  margin-bottom: var(--space-xl);
}

.payment-card-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .payment-card-footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Plan selection */
.plan-options {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .plan-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.plan-option {
  position: relative;
  padding: var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.plan-option:hover {
  border-color: var(--brand-light);
}

.plan-option.selected {
  border-color: var(--brand);
  background-color: var(--brand-lighter);
}

.plan-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-option-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.plan-option-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text);
}

.plan-option-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.plan-option.selected .plan-option-check {
  background-color: var(--brand);
  border-color: var(--brand);
}

.plan-option.selected .plan-option-check::after {
  content: '';
  width: 8px;
  height: 8px;
  background-color: var(--white);
  border-radius: var(--radius-full);
}

.plan-option-price {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--brand);
}

.plan-option-period {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Address confirmation */
.address-display {
  padding: var(--space-lg);
  background-color: var(--input-fill);
  border-radius: var(--radius-lg);
}

.address-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-light);
  margin-bottom: var(--space-sm);
}

.address-text {
  font-size: var(--text-base);
  color: var(--text);
  line-height: var(--leading-relaxed);
}

/* Payment success */
.success-layout {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg-gradient);
}

.success-card {
  text-align: center;
  max-width: 480px;
  padding: var(--space-2xl);
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-xl);
  background-color: var(--success-bg);
  border-radius: var(--radius-full);
  color: var(--success);
}

.success-icon svg {
  width: 40px;
  height: 40px;
}

.success-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text);
  margin-bottom: var(--space-md);
}

.success-message {
  font-size: var(--text-base);
  color: var(--text-light);
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}

.success-details {
  padding: var(--space-lg);
  background-color: var(--input-fill);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  text-align: start;
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
}

.success-detail-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.success-detail-label {
  color: var(--text-light);
}

.success-detail-value {
  font-weight: var(--font-medium);
  color: var(--text);
}
