/**
 * TradeJournal Modern UI - TradeZella Style
 * Version: 2.0.0
 * Inspired by: TradeZella.com
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors */
    --tj-primary: #6366f1;
    --tj-primary-dark: #4f46e5;
    --tj-primary-light: #818cf8;
    
    /* Success & Danger Colors */
    --tj-success: #10b981;
    --tj-success-light: #34d399;
    --tj-danger: #ef4444;
    --tj-danger-light: #f87171;
    
    /* Neutral Colors */
    --tj-gray-50: #f9fafb;
    --tj-gray-100: #f3f4f6;
    --tj-gray-200: #e5e7eb;
    --tj-gray-300: #d1d5db;
    --tj-gray-400: #9ca3af;
    --tj-gray-500: #6b7280;
    --tj-gray-600: #4b5563;
    --tj-gray-700: #374151;
    --tj-gray-800: #1f2937;
    --tj-gray-900: #111827;
    
    /* Background Colors */
    --tj-bg-primary: #ffffff;
    --tj-bg-secondary: #f9fafb;
    --tj-bg-tertiary: #f3f4f6;
    
    /* Text Colors */
    --tj-text-primary: #111827;
    --tj-text-secondary: #6b7280;
    --tj-text-tertiary: #9ca3af;
    
    /* Border & Shadows */
    --tj-border: #e5e7eb;
    --tj-border-light: #f3f4f6;
    --tj-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --tj-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --tj-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --tj-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --tj-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --tj-radius-sm: 0.375rem;
    --tj-radius: 0.5rem;
    --tj-radius-md: 0.75rem;
    --tj-radius-lg: 1rem;
    --tj-radius-xl: 1.5rem;
    
    /* Transitions */
    --tj-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --tj-transition-fast: all 0.15s ease;
    
    /* Font Family */
    --tj-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --tj-bg-primary: #111827;
    --tj-bg-secondary: #1f2937;
    --tj-bg-tertiary: #374151;
    
    --tj-text-primary: #f9fafb;
    --tj-text-secondary: #d1d5db;
    --tj-text-tertiary: #9ca3af;
    
    --tj-border: #374151;
    --tj-border-light: #4b5563;
    
    --tj-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --tj-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --tj-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

/* ==================== Global Styles ==================== */
.tj-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tj-section {
    padding: 3rem 0;
}

/* ==================== Dashboard Layout ==================== */
.tj-dashboard {
    display: grid;
    gap: 1.5rem;
    padding: 2rem 0;
}

.tj-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tj-dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tj-text-primary);
    margin: 0;
}

.tj-dashboard-subtitle {
    font-size: 0.95rem;
    color: var(--tj-text-secondary);
    margin-top: 0.25rem;
}

/* ==================== Cards ==================== */
.tj-card {
    background: var(--tj-bg-primary);
    border-radius: var(--tj-radius-lg);
    border: 1px solid var(--tj-border);
    padding: 1.5rem;
    transition: var(--tj-transition);
    box-shadow: var(--tj-shadow-sm);
}

.tj-card:hover {
    box-shadow: var(--tj-shadow-md);
    transform: translateY(-2px);
}

.tj-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tj-border-light);
}

.tj-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tj-text-primary);
    margin: 0;
}

.tj-card-body {
    padding: 0;
}

.tj-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tj-border-light);
}

/* Stat Cards */
.tj-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tj-stat-card {
    background: var(--tj-bg-primary);
    border-radius: var(--tj-radius-lg);
    border: 1px solid var(--tj-border);
    padding: 1.5rem;
    transition: var(--tj-transition);
    box-shadow: var(--tj-shadow-sm);
}

.tj-stat-card:hover {
    box-shadow: var(--tj-shadow-md);
    border-color: var(--tj-primary-light);
}

.tj-stat-label {
    font-size: 0.875rem;
    color: var(--tj-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.tj-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tj-text-primary);
    margin-bottom: 0.5rem;
}

.tj-stat-change {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.tj-stat-change.positive {
    color: var(--tj-success);
}

.tj-stat-change.negative {
    color: var(--tj-danger);
}

.tj-stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tj-radius);
    margin-bottom: 1rem;
}

.tj-stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tj-success);
}

.tj-stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--tj-danger);
}

.tj-stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--tj-primary);
}

/* ==================== Buttons ==================== */
.tj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--tj-radius);
    border: none;
    cursor: pointer;
    transition: var(--tj-transition);
    text-decoration: none;
    font-family: var(--tj-font);
    gap: 0.5rem;
}

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

.tj-btn-primary:hover {
    background: var(--tj-primary-dark);
    box-shadow: var(--tj-shadow-md);
}

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

.tj-btn-success:hover {
    background: #059669;
    box-shadow: var(--tj-shadow-md);
}

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

.tj-btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--tj-shadow-md);
}

.tj-btn-outline {
    background: transparent;
    border: 1px solid var(--tj-border);
    color: var(--tj-text-primary);
}

.tj-btn-outline:hover {
    background: var(--tj-bg-secondary);
    border-color: var(--tj-primary);
    color: var(--tj-primary);
}

.tj-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.tj-btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

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

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

.tj-input,
.tj-select,
.tj-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--tj-text-primary);
    background: var(--tj-bg-primary);
    border: 1px solid var(--tj-border);
    border-radius: var(--tj-radius);
    transition: var(--tj-transition);
    font-family: var(--tj-font);
}

.tj-input:focus,
.tj-select:focus,
.tj-textarea:focus {
    outline: none;
    border-color: var(--tj-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tj-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==================== Table ==================== */
.tj-table-container {
    overflow-x: auto;
    border-radius: var(--tj-radius-lg);
    border: 1px solid var(--tj-border);
    background: var(--tj-bg-primary);
}

.tj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.tj-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--tj-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.tj-table td {
    padding: 1rem;
    border-top: 1px solid var(--tj-border);
    color: var(--tj-text-primary);
}

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

/* ==================== Badges ==================== */
.tj-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--tj-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tj-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tj-success);
}

.tj-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--tj-danger);
}

.tj-badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--tj-primary);
}

.tj-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* ==================== Alerts ==================== */
.tj-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--tj-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.tj-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

/* ==================== Charts & Visualizations ==================== */
.tj-chart-container {
    position: relative;
    height: 400px;
    padding: 1.5rem;
    background: var(--tj-bg-primary);
    border-radius: var(--tj-radius-lg);
    border: 1px solid var(--tj-border);
    margin-bottom: 1.5rem;
}

.tj-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tj-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tj-text-primary);
}

.tj-chart-filters {
    display: flex;
    gap: 0.5rem;
}

/* ==================== Progress Bar ==================== */
.tj-progress {
    width: 100%;
    height: 0.5rem;
    background: var(--tj-bg-tertiary);
    border-radius: var(--tj-radius);
    overflow: hidden;
}

.tj-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: var(--tj-radius);
}

.tj-progress-bar.success {
    background: var(--tj-success);
}

.tj-progress-bar.danger {
    background: var(--tj-danger);
}

.tj-progress-bar.primary {
    background: var(--tj-primary);
}

/* ==================== Trade List ==================== */
.tj-trade-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tj-trade-item {
    background: var(--tj-bg-primary);
    border: 1px solid var(--tj-border);
    border-radius: var(--tj-radius-lg);
    padding: 1.25rem;
    transition: var(--tj-transition);
    cursor: pointer;
}

.tj-trade-item:hover {
    box-shadow: var(--tj-shadow-md);
    border-color: var(--tj-primary-light);
}

.tj-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tj-trade-symbol {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tj-text-primary);
}

.tj-trade-date {
    font-size: 0.8125rem;
    color: var(--tj-text-secondary);
}

.tj-trade-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.tj-trade-detail {
    display: flex;
    flex-direction: column;
}

.tj-trade-detail-label {
    font-size: 0.75rem;
    color: var(--tj-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.tj-trade-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tj-text-primary);
}

.tj-trade-detail-value.positive {
    color: var(--tj-success);
}

.tj-trade-detail-value.negative {
    color: var(--tj-danger);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .tj-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .tj-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tj-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tj-trade-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tj-chart-container {
        height: 300px;
    }
}

/* ==================== Utilities ==================== */
.tj-text-center {
    text-align: center;
}

.tj-text-right {
    text-align: right;
}

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

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

.tj-flex {
    display: flex;
}

.tj-items-center {
    align-items: center;
}

.tj-justify-between {
    justify-content: space-between;
}

.tj-gap-2 {
    gap: 1rem;
}

.tj-gap-3 {
    gap: 1.5rem;
}

/* ==================== Loading States ==================== */
.tj-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.tj-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--tj-border);
    border-top-color: var(--tj-primary);
    border-radius: 50%;
    animation: tj-spin 0.8s linear infinite;
}

@keyframes tj-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Empty States ==================== */
.tj-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.tj-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.tj-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tj-text-primary);
    margin-bottom: 0.5rem;
}

.tj-empty-description {
    font-size: 0.875rem;
    color: var(--tj-text-secondary);
    margin-bottom: 1.5rem;
}
