/* =========================================
     CLAVIER ARABE ™ - GLOBAL STYLES
     ========================================= */

/* --- VARIABLES & RESET --- */
:root {
    --primary: #0066cc;
    --primary-hover: #004c99;
    --bg-body: #f4f6f8;
    --bg-surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --key-bg: #ffffff;
    --key-border: #d1d5db;
    --key-shadow: #9ca3af;
    --action-bg: #4b5563;
    --action-hover: #374151;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* --- GLOBAL LAYOUT GRIDS --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.grid-layout {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 20px;
    align-items: start;
}

/* --- FULL WIDTH HEADER & FOOTER --- */
.full-width-header,
.full-width-footer {
    width: 100%;
    background: var(--bg-surface);
}

.full-width-header {
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    padding: 15px 0;
    margin-bottom: 30px;
}

.full-width-footer {
    border-top: 1px solid #e5e7eb;
    padding: 25px 0;
    margin-top: auto;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.header-inner h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.header-inner h1 span {
    color: var(--primary);
}

.header-inner .logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    gap: 10px;
    text-decoration: none;
}

.tiny {
    color: var(--primary);
    font-size: 15px;
}

.header-inner a:hover {
    text-decoration: none;
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-muted);
    font-weight: 400;
}
.footer-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* --- TOGGLE SWITCH --- */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.toggle-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.toggle-track {
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 30px;
    position: relative;
    transition: 0.3s;
}
.toggle-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.toggle-container.active .toggle-track {
    background: var(--primary);
}
.toggle-container.active .toggle-thumb {
    left: 23px;
}
.toggle-container.active .toggle-label {
    color: var(--primary);
}

/* --- MAIN PANEL & ADS --- */
.main-content-area {
    flex: 1;
}
.main-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.ad-sidebar {
    min-width: 160px;
    min-height: 600px;
    position: sticky;
    top: 20px;
}

/* --- BOXED SECTIONS --- */
.boxed-section {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    padding: 20px;
}

/* --- EDITOR AREA (TEXTAREAS) --- */
.editor-card {
    padding: 20px;
}
.text-area-input {
    width: 100%;
    height: 140px;
    padding: 12px;
    font-size: 26px;
    border: 2px solid #adb6bfe3;
    border-radius: 8px;
    direction: rtl;
    font-family: "Amiri", serif;
    resize: none;
    outline: none;
    transition: 0.3s;
    background: #fdfdfd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Tool specific textarea layout (e.g. taller input for tools) */
.tool-textarea {
  height: 200px;
  font-size: 24px;
  resize: vertical;
  margin-bottom: 15px;
}

/* --- TOOLBAR & BUTTONS --- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}
.toolbar-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  background: var(--key-bg);
  border: 1px solid var(--key-border);
  border-bottom: 3px solid var(--key-shadow);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  transition: background 0.1s, transform 0.1s, border-bottom-width 0.1s;
  font-size: 0.95rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  user-select: none;
}
.btn:hover {
  background: #eceef1;
}
.btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  margin-bottom: 2px;
  background: #e5e7eb;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: #004c99;
  border-bottom-color: #003366;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:active {
  background: #004080;
}
.btn-danger {
  color: #dc2626;
}

/* --- VIRTUAL KEYBOARD --- */
.keyboard-container {
    background: #f9fafb;
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    width: 100%;
}
.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
    width: 100%;
}

.key {
    background: var(--key-bg);
    border: 1px solid var(--key-border);
    border-bottom: 4px solid var(--key-shadow);
    border-radius: 6px;
    padding: 6px 0;
    font-size: clamp(13px, 3vw, 20px);
    cursor: pointer;
    color: #111827;
    font-family: "Amiri", serif;
    text-align: center;
    transition: background 0.1s, transform 0.1s;
    user-select: none;
    flex: 1 1 0;
    min-width: 0;
    max-width: 48px;
}
.key:hover {
    background: #eaebed;
}
.key:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    margin-bottom: 3px;
    background: #e5e7eb;
}

.key-action {
    background: var(--action-bg);
    color: white;
    border-color: #374151;
    border-bottom-color: #1f2937;
    font-family: "Inter", sans-serif;
    font-size: clamp(10px, 2.5vw, 13px);
    font-weight: 600;
    flex: 2 1 0;
    max-width: 80px !important;
}
.key-action:hover {
    background: var(--action-hover);
}

.space-row {
    margin-top: 4px;
    margin-bottom: 10px;
}
.key-space {
    flex: 6 1 0;
    max-width: 350px !important;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--text-muted);
    padding: 12px 0;
}
.key-diacritic {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-bottom-color: #93c5fd;
    color: var(--primary);
}

/* --- SEO CONTENT SECTION --- */
.content-section {
    padding: 40px;
}
.content-section h2 {
    font-size: 1.7rem;
    margin-bottom: 15px;
    color: #111827;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}
.content-section h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #374151;
}
.content-section p {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 1.05rem;
}
.content-section ul {
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-muted);
}
.content-section li {
    margin-bottom: 8px;
}

/* --- TOAST NOTIFICATION --- */
.toast {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    z-index: 1000;
}
.toast.show {
    bottom: 30px;
    opacity: 1;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .ad-sidebar {
        display: none;
    }
    .header-spacer,
    .footer-spacer {
        display: none;
    }
}
@media (max-width: 768px) {
    .boxed-section {
        padding: 15px;
    }
    .content-section {
        padding: 25px 15px;
    }
    .header-inner,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    .toolbar {
        justify-content: center;
    }
    .text-area-input {
        height: 120px;
        font-size: 22px;
    }
    .tool-textarea {
        height: 180px;
    }
    .key {
        padding: 6px 0;
        border-radius: 4px;
    }
    .keyboard-row {
          gap: 3px;
    }
    .header-inner .btn {
        display: none;
    }
}
