/**
 * Base Styles
 * Reset, normalize, and base element styles
 *
 * @package Vanilly
 */

/* Variables are loaded separately via functions.php */

/* CSS Reset & Normalize */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
    max-width: 100%;
    direction: rtl;
    text-align: right;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

p {
    margin-bottom: var(--spacing-md);
}

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

a:hover,
a:focus {
    color: var(--color-link-hover);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    width: auto;
}

/* Prevent media elements from causing overflow */
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

svg {
    max-width: 100%;
    height: auto;
}

/* Lists - RTL Support */
ul, ol {
    margin-bottom: var(--spacing-md);
    padding-right: var(--spacing-lg); /* RTL: padding on right */
    padding-left: 0;
    list-style-position: inside;
}

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* 404 Error Page Styles */
.error-404 {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) 0;
}

.error-404-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-404-title {
    font-size: 120px;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--spacing-lg);
}

.error-404-heading {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.error-404-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    margin-bottom: var(--spacing-2xl);
    line-height: var(--line-height-relaxed);
}

.error-404-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-2xl);
}

.error-404-actions .btn-primary {
    background: linear-gradient(180deg, #8476E4 0%, #6555D3 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0px 8px 24px 0px #6555D366;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.error-404-actions .btn-primary:hover {
    transform: translateY(-2px);
    color: #FFFFFF;
    text-decoration: none;
}

.error-404-actions .btn-secondary {
    background: #FFFFFF;
    color: #6555D3;
    border: 2px solid #6555D3;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.error-404-actions .btn-secondary:hover {
    background: #6555D3;
    color: #FFFFFF;
    text-decoration: none;
}

.error-404-search {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-2xl);
    border-top: 1px solid var(--color-border);
}

.error-404-search h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.error-404-search .search-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #DEE1E8;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.error-404-search .search-form label {
    flex: 1;
    margin: 0;
    padding: 0;
}

.error-404-search .search-form-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--color-text);
    outline: none;
    font-family: var(--font-primary);
}

.error-404-search .search-form-input::placeholder {
    color: #9CA3AF;
}

.error-404-search .search-submit {
    background: #F3F4F6;
    border: none;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    transition: background 0.2s ease;
    color: #6B7280;
}

.error-404-search .search-submit:hover {
    background: #E5E7EB;
    color: #6555D3;
}

.error-404-search .search-submit svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .error-404-title {
        font-size: 80px;
    }
    
    .error-404-heading {
        font-size: var(--font-size-2xl);
    }
    
    .error-404-actions {
        flex-direction: column;
    }
    
    .error-404-actions .btn {
        width: 100%;
    }
}

