/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Dark mode colors */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #34d399;
    --error-color: #f87171;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

/* Auto mode respects system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-color: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
        --success-color: #34d399;
        --error-color: #f87171;
        --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-image {
    height: 40px;
    width: auto;
    display: block;
    color: var(--text-color);
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary-color);
}

.language-switcher {
    margin-left: 1.5rem;
    position: relative;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.language-toggle:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-color);
}

.language-toggle .language-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-toggle .language-icon svg {
    width: 100%;
    height: 100%;
}

.language-toggle .lang-name {
    font-size: 0.875rem;
}

.language-toggle .dropdown-arrow {
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background-color: var(--bg-color);
}

.language-option .lang-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Theme Switcher */
.theme-switcher {
    margin-left: 1.5rem;
    position: relative;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-color);
}

.theme-toggle .theme-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .theme-icon svg {
    width: 100%;
    height: 100%;
}

.theme-toggle .dropdown-arrow {
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    display: none;
    z-index: 1000;
}

.theme-dropdown.show {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.theme-option .theme-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-option .theme-icon svg {
    width: 100%;
    height: 100%;
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background-color: var(--bg-color);
}

.theme-option.active {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.theme-option .theme-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main Container */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Hero Section (Homepage) */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Tools Section (Homepage) */
.tools-section {
    margin-top: 3rem;
}

.tools-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

/* Tool Grid (Homepage) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Tool Page Layout */
.tool-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

.tool-main {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Page Title and Description */
.page-title, .tool-main h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.page-description, .tool-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Input and Output Sections */
.input-section, .output-section {
    margin-bottom: 1.5rem;
}

.char-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: right;
}

/* Alert Message */
.alert-message {
    min-height: 0;
    transition: all 0.3s;
}

.alert-message:not(:empty) {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-message.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    min-height: 200px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

button,
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

/* Ad Containers and Labels */
.ad-container {
    margin: 1.5rem 0;
}

.ad-container-banner {
    width: 100%;
    max-width: 728px;
    margin: 2rem auto;
    text-align: center;
}

.ad-container-sidebar {
    width: 100%;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Ad Units */
.ad-banner,
.ad-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.ad-banner {
    min-height: 90px;
    width: 100%;
    max-width: 728px;
    margin: 0 auto;
}

.ad-sidebar {
    width: 100%;
    min-height: 250px;
}

/* Ad Placeholders (Development Mode) */
.ad-placeholder {
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.ad-placeholder-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.ad-placeholder-content p {
    margin: 0.25rem 0;
}

.ad-placeholder-content strong {
    color: var(--text-color);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Copy Button */
.copy-btn {
    position: relative;
}

.copy-btn.copied::after {
    content: "Copied!";
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        order: 2;
    }

    .tool-main {
        order: 1;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        margin: 0 0.75rem;
    }

    .ad-banner {
        width: 300px;
        height: 250px;
    }

    .logo-image {
        height: 32px;
    }
}

/* SEO Content Section */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.seo-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.seo-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.seo-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Links in SEO Content */
.seo-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.seo-content a:hover {
    color: var(--primary-hover);
    text-decoration-thickness: 2px;
}

.seo-content a:visited {
    color: var(--primary-color);
    opacity: 0.85;
}

/* RTL Support for Arabic */
[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] nav a {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir="rtl"] .language-toggle .dropdown-arrow {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .char-counter {
    text-align: left;
}

[dir="rtl"] .seo-content ul {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir="rtl"] .button-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-option {
    flex-direction: row-reverse;
}

[dir="rtl"] .theme-switcher {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir="rtl"] .theme-toggle .dropdown-arrow {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .theme-dropdown {
    right: auto;
    left: 0;
}

/* ============================================================================
   Cookie Consent Banner (GDPR Compliance)
   ============================================================================ */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -2px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-consent-banner.show {
    opacity: 1;
    transform: translateY(0);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.cookie-consent-description {
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.cookie-consent-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Cookie Button Styles */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.cookie-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.cookie-btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cookie-btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.cookie-btn-secondary:hover {
    background-color: var(--border-color);
}

.cookie-btn-text {
    background-color: transparent;
    color: var(--primary-color);
    text-decoration: underline;
    padding: 0.75rem 1rem;
}

.cookie-btn-text:hover {
    color: var(--primary-hover);
}

/* Cookie Preferences Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
}

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

.cookie-modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.cookie-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-body > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

/* Cookie Category */
.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cookie-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
}

.cookie-toggle-checkbox {
    appearance: none;
    width: 3rem;
    height: 1.75rem;
    background-color: var(--border-color);
    border-radius: 1rem;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.cookie-toggle-checkbox:checked {
    background-color: var(--primary-color);
}

.cookie-toggle-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 50%;
    top: 0.25rem;
    left: 0.25rem;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cookie-toggle-checkbox:checked::before {
    transform: translateX(1.25rem);
}

.cookie-category-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.cookie-category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-category-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.cookie-category-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    line-height: 1.6;
}

.cookie-category-note strong {
    color: var(--text-color);
}

/* Cookie Settings Button (floating) */
.cookie-settings-button {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 9998;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-settings-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

/* RTL Support for Cookie Consent */
[dir="rtl"] .cookie-settings-button {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .cookie-consent-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-modal-footer {
    justify-content: flex-start;
}

[dir="rtl"] .cookie-category-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-toggle-label {
    flex-direction: row-reverse;
}

/* Responsive Design for Cookie Consent */
@media (max-width: 768px) {
    .cookie-consent-content {
        gap: 1rem;
    }

    .cookie-consent-title {
        font-size: 1.1rem;
    }

    .cookie-consent-description,
    .cookie-consent-details {
        font-size: 0.875rem;
    }

    .cookie-consent-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-modal-content {
        max-width: 100%;
        margin: 0.5rem;
        max-height: 95vh;
    }

    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }

    .cookie-settings-button {
        bottom: 0.5rem;
        left: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    [dir="rtl"] .cookie-settings-button {
        left: auto;
        right: 0.5rem;
    }
}

/* ============================================================================
   Legal Content Pages (Imprint, Privacy Policy)
   ============================================================================ */

.legal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.legal-content h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.legal-content h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.legal-content h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.legal-content p {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.legal-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.legal-content li {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.2s;
}

.legal-content a:hover {
    color: var(--primary-hover);
}

/* Responsive Design for Legal Content */
@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem;
    }

    .legal-content h1 {
        font-size: 1.75rem;
    }

    .legal-content h2 {
        font-size: 1.35rem;
        margin-top: 2rem;
    }

    .legal-content h3 {
        font-size: 1.15rem;
        margin-top: 1.5rem;
    }

    .legal-content ul {
        margin-left: 1.5rem;
    }
}

/* ============================================================================
   Error Pages (403, 404, 500, etc.)
   ============================================================================ */

.error-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 3rem auto;
    text-align: center;
}

.error-title {
    font-size: 2.5rem;
    color: var(--error-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.error-description {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.error-suggestion {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.error-suggestion a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.error-suggestion a:hover {
    color: var(--primary-hover);
}

/* Responsive Design for Error Pages */
@media (max-width: 768px) {
    .error-container {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
    }

    .error-title {
        font-size: 2rem;
    }

    .error-description {
        font-size: 1.1rem;
    }

    .error-suggestion {
        font-size: 0.95rem;
    }
}

/* ============================================================================
   FAQ Page
   ============================================================================ */

.faq-container {
    margin-top: 2rem;
}

.faq-section {
    margin-bottom: 3rem;
}

.faq-section h2 {
    font-size: 1.75rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.faq-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.faq-question {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.faq-answer p {
    margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 3rem 2rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-top: 3rem;
}

.faq-cta h2 {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1rem;
}

.faq-cta p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.faq-cta .btn-primary {
    background-color: white;
    color: var(--primary-color);
    font-weight: 700;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.faq-cta .btn-primary:hover {
    background-color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design for FAQ */
@media (max-width: 768px) {
    .faq-section h2 {
        font-size: 1.5rem;
    }

    .faq-item {
        padding: 1.25rem;
    }

    .faq-question {
        font-size: 1.1rem;
    }

    .faq-answer {
        font-size: 0.95rem;
    }

    .faq-cta {
        padding: 2rem 1.5rem;
    }

    .faq-cta h2 {
        font-size: 1.5rem;
    }

    .faq-cta p {
        font-size: 1rem;
    }
}

/* ============================================================================
   Code Examples
   ============================================================================ */

.code-examples {
    margin-top: 1.5rem;
}

.code-examples h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.code-examples pre {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.code-examples code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    display: block;
    white-space: pre;
}

/* Dark mode code blocks */
[data-theme="dark"] .code-examples pre {
    background: #0f172a;
    border-color: #334155;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .code-examples pre {
        background: #0f172a;
        border-color: #334155;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .code-examples h4 {
        font-size: 1rem;
    }

    .code-examples pre {
        padding: 0.75rem;
    }

    .code-examples code {
        font-size: 0.85rem;
    }
}