/* Persian Web Development Tutorial - Main CSS */

/* Font Face Declarations */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* CSS Variables for Theme Support */
:root {
    /* Light Theme Colors */
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
    
    /* Layout Variables */
    --sidebar-width: 280px;
    --header-height: 60px;
    --border-radius: 8px;
    --border-radius-small: 4px;
    --transition-speed: 0.3s;
    
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --primary-color: #4dabf7;
    --primary-hover: #339af0;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --danger-color: #ff6b6b;
    --border-color: #404040;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-medium: rgba(255, 255, 255, 0.15);
    --shadow-heavy: rgba(255, 255, 255, 0.25);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

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: 1rem;
    line-height: 1.7;
}

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

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-right: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Code Styling */
code {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--border-radius-small);
    color: var(--text-color);
    direction: ltr;
    text-align: left;
    display: inline-block;
}

pre {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1rem;
    direction: ltr;
    text-align: left;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    text-decoration: none;
}

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

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

/* Cards */
.card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-light);
    transition: box-shadow var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin-bottom: 0.5rem;
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: var(--font-size-sm);
    }
}

