/*
Theme Name: Digital Store Pro
Theme URI: https://example.com/digital-store-pro
Author: DexterStark
Author URI: https://example.com
Description: A premium WordPress theme tailored for digital products, templates, art, and video tutorials. Contains custom designs synced with Elementor.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: digital-store-pro
Tags: e-commerce, dark-mode, templates, gallery, blog
*/

/* ==========================================================================
   Google Fonts
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   CSS Custom Properties (Variables)
   Mapped to design system and synced with Elementor Globals
   ========================================================================== */
:root {
  /* Elementor Global Mappings */
  --e-global-color-primary: #6C5CE7;
  --e-global-color-secondary: #00CEC9;
  --e-global-color-text: #2d3436;
  --e-global-color-accent: #E17055;

  /* Theme Design System */
  --primary-gradient: linear-gradient(135deg, #6C5CE7, #00CEC9);
  
  --color-ui-templates: #00CEC9;      /* teal */
  --color-coded-templates: #6C5CE7;   /* purple */
  --color-social-graphics: #E17055;   /* orange */
  --color-video-tutorials: #FDCB6E;   /* yellow */
  
  --dark-bg: #1a1a2e;
  --body-bg: #f8f9fa;
  --card-bg: #ffffff;
  
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --border-color: #dfe6e9;
  
  /* Additional UI Values */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-speed: 0.3s;
}

/* Dark Mode Overrides */
body.dark-mode {
  --body-bg: var(--dark-bg);
  --card-bg: #16213e;
  --text-primary: #f5f6fa;
  --text-secondary: #b2bec3;
  --border-color: #2d3436;
  
  --e-global-color-text: #f5f6fa;
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Base Typography
   ========================================================================== */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 { font-size: 48px; line-height: 1.2; }
h2 { font-size: 36px; line-height: 1.3; }
h3 { font-size: 24px; line-height: 1.4; }
h4 { font-size: 20px; line-height: 1.5; }

p {
  color: var(--text-secondary);
}

/* ==========================================================================
   Global Utilities
   ========================================================================== */

/* 8. Gradient Text */
.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* 9. Gradient Background */
.gradient-background {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  transition: opacity var(--transition-speed);
}
.gradient-background:hover {
  opacity: 0.9;
  color: #fff;
}


/* ==========================================================================
   Components CSS
   ========================================================================== */

/* 1. Featured Item Card */
.featured-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
  position: relative;
  display: flex;
  flex-direction: column;
}
.featured-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* 2. Category Card */
.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
  padding: 30px;
  overflow: hidden;
  color: #fff;
  transition: transform var(--transition-speed);
  text-decoration: none;
  min-height: 160px;
}
.category-card:hover {
  transform: scale(1.05);
  color: #fff;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  opacity: 0.9;
}
/* Diagonal background overlays based on respective classes */
.category-card.ui-templates::before { background: linear-gradient(135deg, var(--color-ui-templates), #0984e3); }
.category-card.coded-templates::before { background: linear-gradient(135deg, var(--color-coded-templates), #a29bfe); }
.category-card.social-graphics::before { background: linear-gradient(135deg, var(--color-social-graphics), #fdcb6e); }
.category-card.video-tutorials::before { background: linear-gradient(135deg, var(--color-video-tutorials), #e17055); }

.category-card-content {
  z-index: 1;
  position: relative;
  font-weight: 600;
  font-size: 1.2rem;
}

/* 3. Seller Card */
.seller-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: box-shadow var(--transition-speed), transform var(--transition-speed), background-color var(--transition-speed);
}
.seller-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* 4. News Item */
.news-item {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-speed), background-color var(--transition-speed);
}
.news-item:hover {
  box-shadow: var(--shadow-md);
}
.news-item .thumbnail {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  background-color: var(--border-color);
}
.news-item .thumbnail img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}
.news-item:hover .thumbnail img {
  transform: scale(1.05);
}
.news-item .content-layout {
  padding: 24px;
}

/* 5. Dropdowns (Cart & Notifications) */
.cart-dropdown, 
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-hover);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-speed), transform var(--transition-speed), visibility var(--transition-speed);
  z-index: 999;
}
/* Activate dropdown on parent hover/focus */
.dropdown-trigger:hover .cart-dropdown,
.dropdown-trigger:hover .notifications-dropdown,
.dropdown-trigger:focus-within .cart-dropdown,
.dropdown-trigger:focus-within .notifications-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 6. Avatar + Verified Badge */
.avatar {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar.verified::after {
  content: '✓';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background-color: var(--color-ui-templates);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

/* 7. Item Rating */
.item-rating {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.item-rating .star {
  color: var(--border-color);
}
.item-rating .star.filled {
  color: var(--color-video-tutorials); /* yellow */
}

/* 10. Sticky Header */
.dsp-header {
  position: relative;
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}
.dsp-header.dsp-header--sticky {
  position: sticky;
  top: 0;
  box-shadow: var(--shadow-sm);
}

/* 12. Swiper Carousel Fixes */
.swiper-button-next,
.swiper-button-prev {
  background: var(--card-bg);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
}
.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 16px !important;
}
.swiper-pagination-bullet-active {
  background: var(--e-global-color-primary) !important;
}

/* ==========================================================================
   13. Responsive Breakpoints
   ========================================================================== */
@media screen and (max-width: 768px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
  
  .cart-dropdown,
  .notifications-dropdown {
    width: 100%;
    position: fixed;
    top: 60px; /* Adjust based on your mobile header height */
    left: 0;
    right: 0;
    border-radius: 0 0 16px 16px;
    border-top: none;
  }
}

@media screen and (max-width: 480px) {
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  
  .seller-card {
    padding: 16px;
  }
  .news-item .content-layout {
    padding: 16px;
  }
  .category-card {
    min-height: 120px;
  }
}
/* ==========================================================================
   Dashboard & Profile Pages
   ========================================================================== */
.dsp-dashboard-wrapper {
  padding: 60px 0;
}
.dsp-dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.dsp-dashboard-sidebar-area {
  flex: 0 0 280px;
}
.dsp-dashboard-content-area {
  flex: 1;
  min-width: 0;
}

/* Dashboard Nav */
.dashboard-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dashboard-nav-list li a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-speed);
  font-weight: 500;
  margin-bottom: 4px;
}
.dashboard-nav-list li a:hover {
  background: rgba(108, 92, 231, 0.08);
  color: var(--e-global-color-primary);
  padding-left: 20px;
}
.dashboard-nav-list li.active a {
  background: var(--primary-gradient);
  color: #fff !important;
}

/* Form Styles */
.dsp-form-group {
  margin-bottom: 20px;
}
.dsp-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}
.dsp-input, .dsp-textarea, .dsp-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--body-bg);
  color: var(--text-primary);
  transition: border-color var(--transition-speed);
}
.dsp-input:focus, .dsp-textarea:focus {
  border-color: var(--e-global-color-primary);
  outline: none;
}
.dsp-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dashboard Cards & Tables */
.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
}
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}
.dashboard-table th {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-secondary);
}
.dashboard-table td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--border-color);
}
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.completed { background: rgba(0, 206, 201, 0.1); color: #00b894; }
.status-badge.pending { background: rgba(253, 203, 110, 0.1); color: #e17055; }

@media screen and (max-width: 991px) {
  .dsp-dashboard-sidebar-area {
    flex: 0 0 100%;
  }
}
