@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Kufam:ital,wght@0,400..900;1,400..900&display=swap');

:root {
  /* Light Mode Colors */
  --bg-color: #f4f7f6;
  --text-color: #2c3e50;
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 4px 6px rgba(0,0,0,0.05);
  --header-bg: rgba(255, 255, 255, 0.9);
  
  --font-main: 'Kufam', sans-serif;
  --font-secondary: 'IBM Plex Sans Arabic', sans-serif;
}

[data-theme="dark"] {
  /* Dark Mode Colors */
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --primary-color: #2980b9;
  --secondary-color: #27ae60;
  --card-bg: #1e1e1e;
  --border-color: #333333;
  --shadow: 0 4px 6px rgba(0,0,0,0.3);
  --header-bg: rgba(18, 18, 18, 0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
  direction: rtl;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-weight: 700;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Sidebar & Navigation */
.sidebar {
  position: fixed;
  right: -300px;
  top: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  transition: right 0.3s ease;
  z-index: 1001;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  right: 0;
}

.sidebar-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

.sidebar-links {
  margin-top: 40px;
  list-style: none;
}

.sidebar-links li {
  margin-bottom: 20px;
}

.sidebar-links a {
  font-size: 1.2rem;
  color: var(--text-color);
  font-family: var(--font-secondary);
}

.sidebar-links a:hover {
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-secondary);
  font-size: 1rem;
  transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
  color: #fff;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 15px;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px 20px;
  background: linear-gradient(135deg, var(--bg-color), var(--card-bg));
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Sections */
section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.card.locked::after {
  content: 'قريباً';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  font-family: var(--font-secondary);
}

/* Footer */
footer {
  background-color: var(--card-bg);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.social-links {
  margin-bottom: 20px;
}

.social-links a {
  display: inline-block;
  margin: 0 10px;
  font-size: 1.5rem;
  color: var(--text-color);
}

.social-links a:hover {
  color: var(--primary-color);
}

.view-counter {
  margin-top: 20px;
  font-size: 1.1rem;
  font-family: var(--font-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.view-counter span {
  font-weight: bold;
  color: var(--primary-color);
}

/* Tools Page UI */
.tool-container {
  padding-top: 120px;
  min-height: 100vh;
}

.tool-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
}

.controls-panel {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.control-group input[type="range"] {
  width: 100%;
}

.preview-panel {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.preview-text {
  width: 100%;
  flex-grow: 1;
  min-height: 400px;
  border: 1px dashed var(--border-color);
  padding: 20px;
  font-size: 40px;
  outline: none;
  background: transparent;
  color: var(--text-color);
  resize: none;
  font-family: inherit;
}

.feature-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: var(--bg-color);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}

.feature-toggle input {
  margin-left: 10px;
}

.file-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-upload input[type=file] {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 100%;
  min-height: 100%;
  font-size: 100px;
  text-align: right;
  filter: alpha(opacity=0);
  opacity: 0;
  outline: none;
  background: white;
  cursor: inherit;
  display: block;
}

/* Animations */
.fade-in {
  animation: fadeIn 1s ease-in-out;
}

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

@media (max-width: 768px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}
