/* ForexBasics Main Stylesheet - Deferred Loading */

/* Typography */
.text-small { font-size: 0.875rem; }
.text-large { font-size: 1.25rem; }
.text-xl { font-size: 1.5rem; }
.text-2xl { font-size: 2rem; }
.text-3xl { font-size: 2.5rem; }

/* Spacing Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg);
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Cards */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge-primary {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
}

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

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: start;
    gap: 1rem;
}

.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    color: #f59e0b;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(30, 64, 175, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* Progress Bar */
.progress {
    height: 0.75rem;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumb-separator {
    color: var(--text-light);
    user-select: none;
}

/* Content Styles */
.content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.content h1, .content h2, .content h3, .content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.content h1 { font-size: 2.5rem; }
.content h2 { font-size: 2rem; }
.content h3 { font-size: 1.5rem; }
.content h4 { font-size: 1.25rem; }

.content p {
    margin-bottom: 1.5rem;
}

.content ul, .content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-light);
    font-style: italic;
}

.content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.content code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
}

/* Sidebar Layout */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary);
    color: white;
}

/* Calculator Styles */
.calculator {
    max-width: 500px;
    margin: 2rem auto;
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
}

.calculator-result {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.calculator-result-value {
    font-size: 2rem;
    font-weight: 700;
}

.calculator-result-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Author Bio */
.author-bio {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    margin-bottom: 0.25rem;
}

.author-info p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.875rem;
    }

    .data-table th, .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .layout-with-sidebar {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .sidebar {
        position: static;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
    }

    header, footer, .sidebar, .theme-toggle, .breadcrumb {
        display: none !important;
    }

    .content {
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.rounded { border-radius: 0.5rem; }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }