/* CryptoExc - Main Stylesheet */

/* CSS Variables */
:root {
    --primary-dark: #1a1f3a;
    --primary-medium: #2d3561;
    --accent-purple: #6366f1;
    --accent-blue: #8b5cf6;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: #ffffff !important;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Ensure all text is visible */
body, html {
    color: #ffffff !important;
}

/* Default text color for all elements - ensure white text on dark backgrounds */
div, span, p, a, li, td, th, label, small, code, strong, em, b, i, h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

/* Exceptions for specific utility classes */
.text-success {
    color: var(--success-green) !important;
}

.text-danger {
    color: var(--danger-red) !important;
}

.text-muted {
    color: #cbd5e1 !important;
}

/* Links should be visible */
a {
    color: var(--accent-purple) !important;
}

a:hover {
    color: var(--accent-blue) !important;
}

/* Buttons maintain their colors */
.btn-primary, .btn-success, .btn-danger, .btn-outline {
    color: #ffffff !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #ffffff !important;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: #ffffff !important;
}

a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-blue);
}

/* Layout Utilities */
.container-custom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: var(--text-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success-green);
    color: var(--text-primary);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-red);
    color: var(--text-primary);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-purple);
    color: var(--accent-purple);
}

.btn-outline:hover {
    background: var(--accent-purple);
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-medium);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: #ffffff !important;
}

.card * {
    color: #ffffff !important;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-purple);
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #ffffff !important;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff !important;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-green) !important;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-red) !important;
}

.badge {
    color: #ffffff !important;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff !important;
}

.table th {
    font-weight: 600;
    color: #ffffff !important;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

/* Utilities */
.text-success {
    color: var(--success-green);
}

.text-danger {
    color: var(--danger-red);
}

.text-muted {
    color: #cbd5e1 !important;
}

.text-center {
    text-align: center;
}

.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; }

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--accent-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Header Styles */
.header {
    background: var(--bg-medium);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff !important;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.header-icon:hover {
    background: var(--accent-purple);
    color: white;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: var(--danger-red);
    border-radius: 50%;
}

.user-menu {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: 1000;
}

.user-menu-dropdown.active {
    display: block;
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-menu-name {
    font-weight: 600;
    color: #ffffff !important;
}

.user-menu-email {
    font-size: 0.875rem;
    color: #cbd5e1 !important;
    margin-top: 4px;
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    color: #ffffff !important;
    transition: all 0.2s;
}

.user-menu-item:hover {
    background: var(--bg-light);
    color: #ffffff !important;
}

.user-menu-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: var(--bg-medium);
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 80px);
    position: fixed;
    left: 0;
    top: 80px;
    overflow-y: auto;
    padding: 24px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #ffffff !important;
    transition: all 0.3s;
    text-decoration: none;
}

.nav-link:hover {
    color: #ffffff !important;
    background: var(--bg-light);
}

.nav-link.active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent-purple);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.portfolio-summary {
    margin-top: auto;
    padding: 24px;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 24px;
}

.portfolio-summary-title {
    font-size: 0.875rem;
    color: #cbd5e1 !important;
    margin-bottom: 8px;
}

.portfolio-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 4px;
}

.portfolio-summary-change {
    font-size: 0.875rem;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s;
}

.mobile-menu-btn:hover {
    background: var(--bg-light);
}

.mobile-menu {
    display: none;
}

/* Overlay for mobile menu */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: calc(100vh - 80px);
    padding: 40px;
}

/* Footer */
.footer {
    background: var(--bg-medium);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #ffffff !important;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ffffff !important;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-purple);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: #cbd5e1 !important;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
}
