/* إعدادات عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

:root {
  --primary-color: #4285f4;
  --bg-color: #f8f9fa;
  --text-color: #202124;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  --header-bg: #ffffff;
  --input-bg: #ffffff;
  --border-color: #dadce0;
  
  /* ألوان الملاحظات */
  --color-default: #ffffff;
  --color-red: #f28b82;
  --color-orange: #fbbc04;
  --color-yellow: #fff475;
  --color-green: #ccff90;
  --color-blue: #a7ffeb;
  --color-purple: #d7aefb;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* تنسيقات الشريط العلوي */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--header-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.logo i {
  color: var(--primary-color);
  margin-left: 0.5rem;
}

.search-container {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  border-radius: 24px;
  padding: 0.25rem 1rem;
  width: 100%;
  max-width: 500px;
  margin: 0 1rem;
}

.search-container input {
  border: none;
  background: transparent;
  padding: 0.5rem;
  width: 100%;
  outline: none;
  color: var(--text-color);
}

.search-container button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #5f6368;
}

.header-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  transition: background-color 0.2s;
}

.header-actions button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* تنسيقات منطقة إضافة ملاحظة */
.note-input-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.note-input {
  background-color: var(--input-bg);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  padding: 1rem;
  transition: box-shadow 0.3s ease;
}

.note-input:focus-within {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.note-input input,
.note-input textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  outline: none;
  color: var(--text-color);
  resize: none;
}

.note-input input {
  font-size: 1.1rem;
  font-weight: 600;
}

.note-input textarea {
  min-height: 80px;
}

.note-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.color-palette {
  display: flex;
  gap: 0.5rem;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.color-option[data-color="default"] {
  background-color: var(--color-default);
  border: 1px solid var(--border-color);
}

.color-option[data-color="red"] {
  background-color: var(--color-red);
}

.color-option[data-color="orange"] {
  background-color: var(--color-orange);
}

.color-option[data-color="yellow"] {
  background-color: var(--color-yellow);
}

.color-option[data-color="green"] {
  background-color: var(--color-green);
}

.color-option[data-color="blue"] {
  background-color: var(--color-blue);
}

.color-option[data-color="purple"] {
  background-color: var(--color-purple);
}

#add-note {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

#add-note i {
  margin-right: 0.5rem;
}

#add-note:hover {
  background-color: #3367d6;
}

/* تنسيقات عرض الملاحظات */
.notes-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  flex-grow: 1;
}

.notes-filter {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.notes-filter select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--card-bg);
  color: var(--text-color);
  outline: none;
  cursor: pointer;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.note-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.note-card-content {
  padding: 1rem;
  flex-grow: 1;
}

.note-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.note-card-text {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.note-card-date {
  font-size: 0.8rem;
  color: #5f6368;
}

.note-card-actions {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.note-card-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.9rem;
}

.note-card-actions button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.note-card-actions button:first-child {
  border-left: 1px solid var(--border-color);
}

.empty-notes {
  text-align: center;
  padding: 2rem;
  color: #5f6368;
  font-size: 1.1rem;
}

/* تنسيقات النوافذ المنبثقة */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: modalFadeIn 0.3s;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.2rem;
  color: var(--text-color);
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #5f6368;
}

.modal-body {
  padding: 1rem;
}

.modal-body input,
.modal-body textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  outline: none;
  color: var(--text-color);
  background-color: var(--input-bg);
}

.modal-body textarea {
  min-height: 150px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}

.modal-footer button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

#save-edit, #confirm-delete {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

#save-edit:hover, #confirm-delete:hover {
  background-color: #3367d6;
}

#cancel-edit, #cancel-delete {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

#cancel-edit:hover, #cancel-delete:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* تنسيقات الشريط السفلي */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--header-bg);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.notes-count {
  font-size: 0.9rem;
  color: #5f6368;
}

.app-info {
  font-size: 0.9rem;
  color: #5f6368;
}

/* تنسيقات الإشعارات */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #323232;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}
