/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.main-content-padding {
    padding-top: 70px; /* Adjust based on navbar height */
    min-height: calc(100vh - 145px); /* 100vh - header - footer */
}

/* Theme-toggle switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    margin-left: 15px;
}
.theme-switch input {
    display:none;
}
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}
input:checked + .slider {
    background-color: #2196F3;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Dark Mode */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}
.dark-mode .navbar {
    background-color: #1f1f1f;
    border-bottom: 1px solid #333;
}
.dark-mode .nav-menu a {
    color: #e0e0e0;
}
.dark-mode .nav-menu a:hover {
    color: #3498db;
}
.dark-mode .profile-card, .dark-mode .action-card, .dark-mode .trades-table, .dark-mode .kyc-popup {
    background-color: #1e1e1e;
    border: 1px solid #333;
    box-shadow: none;
}
.dark-mode h1, .dark-mode h2, .dark-mode h3 {
    color: #f5f5f5;
}
.dark-mode input, .dark-mode select, .dark-mode textarea {
    background-color: #333;
    color: #f5f5f5;
    border: 1px solid #555;
}
.dark-mode .footer-content {
    background-color: #1f1f1f;
    border-top: 1px solid #333;
}
.dark-mode .footer-bottom {
    background-color: #121212;
}
.dark-mode .status-active {
    color: #2ecc71;
}
.dark-mode .status-inactive {
    color: #e74c3c;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: #007bff;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover {
    color: #007bff;
}

.btn-primary {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-secondary:hover {
    background: #007bff;
    color: white;
}

/* Flash messages */
.flash-messages {
    position: relative; /* Changed from fixed to relative for admin content flow */
    margin-bottom: 20px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.flash-message-success::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.flash-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.flash-message-error::before {
    content: "\f06a"; /* fa-exclamation-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.flash-message-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.flash-message-warning::before {
    content: "\f071"; /* fa-exclamation-triangle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.flash-message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
.flash-message-info::before {
    content: "\f05a"; /* fa-info-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}


/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 150px 0 100px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.crypto-prices h3 {
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.price-item:last-child {
    border-bottom: none;
}

.price {
    font-weight: bold;
}

/* Features */
.features {
    padding: 100px 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    background: #fff;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #007bff;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Trading Section */
.trading-section {
    padding: 80px 0;
    background: #f8f9fa;
}

/* How It Works Section */
.how-it-works {
    padding: 100px 0;
    background: white;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.how-it-works-card {
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    background: #fff;
}

.how-it-works-card:hover {
    transform: translateY(-5px);
}

.how-it-works-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #007bff;
}

.how-it-works-card h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Testimonials Section */
.testimonials {
    padding: 100px 0;
    background: #f8f9fa;
}

.testimonials h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 20px;
}

.testimonial-card span {
    font-weight: bold;
    color: #007bff;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: white;
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.contact form {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.contact input,
.contact textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.contact textarea {
    resize: vertical;
    min-height: 150px;
}

.trading-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.stat-card {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-card h3 {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #ccc;
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-info {
    background: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.balance-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.balance-header h3 {
    margin-bottom: 15px;
    color: #333;
}

.balance-amount {
    display: flex;
    flex-direction: column;
}

.balance-amount span:first-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.usd-value {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.recent-trades-section {
    margin-top: 40px;
}

.trades-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
}

.trades-table table {
    width: 100%;
    border-collapse: collapse;
}

.trades-table th,
.trades-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.trades-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.trade-type-buy {
    color: #28a745;
    font-weight: bold;
}

.trade-type-sell {
    color: #dc3545;
    font-weight: bold;
}

.status-active {
    color: #007bff;
}

.status-settled {
    color: #28a745;
}

.status-cancelled {
    color: #6c757d;
}

/* Trading Dashboard */
.trading-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
}

.user-balance {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 250px;
}

.user-balance h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-list {
    margin-top: 10px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.balance-item:last-child {
    border-bottom: none;
}

.trading-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chart-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.chart-container {
    height: 400px;
    position: relative;
}

.trade-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trade-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.trade-form h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.trade-type-buttons {
    display: flex;
    gap: 10px;
}

.btn-buy, .btn-sell {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-buy {
    background: #28a745;
    color: white;
}

.btn-sell {
    background: #dc3545;
    color: white;
}

.btn-buy.active, .btn-sell.active {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.trade-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.trade-preview h4 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.active-trades {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
}

.active-trades h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trade-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.trade-symbol {
    font-weight: bold;
    font-size: 1.1rem;
}

.trade-type.buy {
    color: #28a745;
}

.trade-type.sell {
    color: #dc3545;
}

.trade-details div {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 90px 20px 20px;
}

.admin-header h1 {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    padding: 20px;
}

.stat-icon {
    font-size: 2rem;
    color: #007bff;
    margin-right: 15px;
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-card h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-card p {
    margin-bottom: 20px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .trading-main {
        grid-template-columns: 1fr;
    }
    
    .trading-header {
        flex-direction: column;
    }
    
    .nav-menu {
        display: none;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        grid-template-columns: 1fr;
    }
}
/* Login and Register Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 90px 20px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.auth-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.btn-auth {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer p {
    color: #666;
    margin-bottom: 15px;
}

.auth-footer a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Password strength indicator */
.password-strength {
    height: 5px;
    background: #eee;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-meter {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
    border-radius: 3px;
}

.strength-weak { background: #dc3545; width: 33%; }
.strength-medium { background: #ffc107; width: 66%; }
.strength-strong { background: #28a745; width: 100%; }

.password-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Remember me and forgot password */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input {
    width: auto;
}

.forgot-password a {
    color: #007bff;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Social login buttons */
.social-login {
    margin: 25px 0;
    text-align: center;
}

.social-login p {
    position: relative;
    color: #666;
    margin-bottom: 20px;
}

.social-login p:before,
.social-login p:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}

.social-login p:before {
    left: 0;
}

.social-login p:after {
    right: 0;
}

.social-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
    border: none;
}

.social-btn:hover {
    transform: translateY(-3px);
}

.google-btn { background: #db4437; }
.facebook-btn { background: #4267B2; }
.twitter-btn { background: #1DA1F2; }

/* Terms and conditions */
.terms {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 20px;
}

.terms a {
    color: #007bff;
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-card {
        margin: 20px;
        max-width: none;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
    
    .auth-header {
        padding: 25px 20px;
    }
    
    .auth-header h2 {
        font-size: 1.7rem;
    }
    
    .auth-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .social-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Error styling for forms */
.form-group.error input {
    border-color: #dc3545;
    background: #fff5f5;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group.success input {
    border-color: #28a745;
    background: #f0fff4;
}

.success-message {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Loading spinner for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Email verification message */
.verification-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Resend verification */
.resend-verification {
    text-align: center;
    margin-top: 15px;
}

.resend-verification a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

/* Notification Popups */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background-color: #f8f9fa;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translateX(0);
    min-width: 250px;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

.notification-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.notification-success::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.notification-error::before {
    content: "\f06a"; /* fa-exclamation-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.notification-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.notification-warning::before {
    content: "\f071"; /* fa-exclamation-triangle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.notification-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
.notification-info::before {
    content: "\f05a"; /* fa-info-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2em;
}

.admin-sidebar {
    width: 250px;
    background-color: #2c3e50; /* Dark blue-gray */
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
}

.admin-logo {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ecf0f1;
}

.admin-menu {
    list-style: none;
    padding: 0;
}

.admin-menu li {
    margin-bottom: 10px;
}

.admin-menu a {
    color: #ecf0f1; /* Light gray */
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.admin-menu a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.admin-menu a:hover, .admin-menu a.active {
    background-color: #34495e; /* Slightly lighter dark blue-gray */
    color: #3498db; /* Bright blue */
}

/* Badge for unseen messages */
.badge {
    background-color: #dc3545; /* Red for new notifications */
    color: white;
    padding: 3px 8px;
    border-radius: 50%;
    font-size: 0.75rem;
    margin-left: 5px;
    vertical-align: super;
    display: none; /* Hidden by default, shown by JS if count > 0 */
}

.admin-main-content {
    margin-left: 250px; /* Same as sidebar width */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background-color: #ffffff;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.8rem;
    color: #333;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-content {
    flex-grow: 1;
    padding: 30px;
    padding-top: 70px; /* Adjust padding for the sticky header */
}

.stat-card {
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}
.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}
.stat-card p {
    margin: 0;
}

.admin-content-inner {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Specific Admin Page Styles (e.g., tables, forms) */
.trades-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.trades-table th, .trades-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

.trades-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #555;
}

.trades-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.trades-table tbody tr:hover {
    background-color: #f2f2f2;
}

.btn-primary, .btn-danger, .btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #218838;
}

/* Form Styles within Admin */
.admin-content form {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.admin-content .form-group {
    margin-bottom: 20px;
}

.admin-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.admin-content .form-group input[type="text"],
.admin-content .form-group input[type="number"],
.admin-content .form-group input[type="email"],
.admin-content .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-content .form-group input:focus,
.admin-content .form-group select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Status Spans */
.status-active, .status-inactive {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Flash Messages for Admin */
.flash-messages-admin {
    margin-bottom: 20px;
}

.flash-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.flash-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Responsive adjustments for admin panel */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 80px;
        align-items: center;
    }

    .admin-sidebar .admin-logo h3 {
        font-size: 1.2rem;
    }

    .admin-sidebar .admin-menu a {
        padding: 10px 5px;
        justify-content: center;
    }

    .admin-sidebar .admin-menu a span {
        display: none; /* Hide text, show only icons */
    }

    .admin-sidebar .admin-menu a i {
        margin-right: 0;
    }

    .admin-main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-around;
        padding: 15px 0;
    }

    .admin-sidebar .admin-logo {
        display: none;
    }

    .admin-sidebar .admin-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }
    
    .admin-sidebar .admin-menu a {
        padding: 8px;
        font-size: 0.9rem;
    }

    .admin-main-content {
        margin-left: 0;
    }

    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

.kyc-popup p {
    margin-bottom: 30px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.5s ease-out;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}
.close-modal-btn:hover {
    color: #333;
}

.dashboard-content {
    display: block;
}

.recent-trades-section {
    padding: 24px;
    min-width: 0;
}

.dashboard-trades-table {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 22px;
}

.dashboard-trades-table table {
    min-width: 100%;
}

@media (min-width: 1100px) {
    .dashboard-trades-table {
        padding-bottom: 6px;
    }

    .dashboard-trades-table table {
        min-width: 1180px;
    }
}

.admin-management-shell,
.admin-support-shell {
    padding: 24px;
}

.admin-management-header,
.admin-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-section-title.compact {
    margin-bottom: 12px;
}

.admin-management-header h2,
.admin-section-title h3 {
    margin: 4px 0 0;
}

.admin-management-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-management-tools input,
.admin-management-tools select {
    min-width: 220px;
}

.admin-users-table table,
.admin-trades-table table {
    min-width: 1180px;
}

.admin-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-password-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(7, 19, 31, 0.82);
    border: 1px solid rgba(164, 189, 217, 0.16);
    color: #eef5ff;
    font-size: 0.85rem;
    word-break: break-all;
}

.admin-online-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.admin-online-state::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
}

.admin-online-state.online {
    color: #8fe0bf;
}

.admin-online-state.offline {
    color: #ffb4be;
}

.btn-info {
    background: linear-gradient(135deg, #406fe0 0%, #5e91ff 100%);
    color: #fff;
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #315dca 0%, #4b7de9 100%);
}

.admin-support-shell .admin-support-layout {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    align-items: start;
}

.admin-communication-panel {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.admin-communication-form,
.admin-communication-log-shell {
    background: rgba(7, 19, 31, 0.76);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
}

.admin-communication-log-list {
    display: grid;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.admin-communication-log-item,
.admin-chat-message {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(164, 189, 217, 0.12);
}

.admin-communication-log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-communication-log-subject {
    margin: 0 0 6px;
    font-weight: 700;
}

.admin-communication-log-body {
    margin: 0;
    white-space: pre-wrap;
    color: var(--text-color);
}

.admin-communication-log-time {
    display: block;
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-ticket-list-item {
    display: grid;
    gap: 6px;
}

.admin-ticket-list-item span {
    color: var(--text-muted);
}

@media (max-width: 1200px) {
    .admin-support-shell .admin-support-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-management-shell,
    .admin-support-shell,
    .recent-trades-section {
        padding: 20px;
    }

    .admin-management-header,
    .admin-section-title {
        display: grid;
    }

    .admin-management-tools {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content-padding {
        padding-top: 72px;
    }

    .navbar {
        min-height: 60px;
    }

    .nav-container {
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .nav-logo h2 {
        font-size: 1.05rem;
    }

    .hamburger i {
        font-size: 20px;
    }

    .admin-support-shell .grid-two {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body {
    color-scheme: dark;
}

body.light-mode {
    color-scheme: dark;
}

.theme-switch-wrapper,
.theme-switch {
    display: none !important;
}

.user-info,
.user-balance,
.dashboard-balance-summary,
.copy-address-btn,
.support-view-details-btn,
.kyc-banner-action {
    opacity: 1 !important;
    visibility: visible !important;
}

.dashboard-header .user-info,
.trading-header .user-balance {
    background: rgba(8, 23, 43, 0.92);
    border: 1px solid rgba(167, 190, 214, 0.16);
    box-shadow: var(--shadow-soft);
}

.dashboard-balance-summary {
    margin-bottom: 24px;
}

.dashboard-balance-summary .total-balance {
    margin-top: 16px;
}

.dashboard-shell .dashboard-content {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
}

.dashboard-shell .balance-section,
.dashboard-shell .recent-trades-section {
    min-width: 0;
}

.dashboard-shell .balance-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.dashboard-shell .carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    width: max-content;
    min-width: 100%;
}

.dashboard-trades-table,
.transaction-history-table,
.support-ticket-table,
.admin-table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.dashboard-trades-table table,
.transaction-history-table table,
.support-ticket-table table,
.admin-table-shell table,
.admin-content table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.dashboard-trades-table th,
.dashboard-trades-table td,
.transaction-history-table th,
.transaction-history-table td,
.support-ticket-table th,
.support-ticket-table td,
.admin-table-shell th,
.admin-table-shell td,
.admin-content table th,
.admin-content table td {
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
}

.transaction-history-table .transaction-table td:nth-child(2),
.transaction-history-table .transaction-table td:nth-child(6),
.dashboard-trades-table td:nth-child(3),
.dashboard-trades-table td:nth-child(4),
.dashboard-trades-table td:nth-child(5),
.dashboard-trades-table td:nth-child(9) {
    white-space: nowrap;
}

.tx-type-badge {
    font-weight: 700;
    letter-spacing: 0;
}

.tx-type-deposit,
.notification-success {
    background: rgba(18, 132, 105, 0.18);
    border-color: rgba(88, 215, 177, 0.28);
    color: #9ef1cf;
}

.tx-type-withdrawal,
.notification-error {
    background: rgba(177, 54, 78, 0.18);
    border-color: rgba(255, 122, 145, 0.26);
    color: #ffb9c4;
}

.tx-type-bonus,
.tx-type-deposit-bonus,
.notification-info {
    background: rgba(217, 163, 77, 0.18);
    border-color: rgba(236, 191, 113, 0.28);
    color: #ffd88b;
}

.tx-type-trade-profit,
.tx-type-swap {
    background: rgba(57, 133, 214, 0.18);
    border-color: rgba(125, 184, 245, 0.24);
    color: #a8d2ff;
}

.tx-type-trade-loss,
.notification-warning {
    background: rgba(199, 108, 36, 0.18);
    border-color: rgba(241, 164, 99, 0.28);
    color: #ffcd94;
}

.notification {
    backdrop-filter: blur(14px);
    border-width: 1px;
}

.notification-title {
    color: inherit;
}

.copy-address-btn,
.support-view-details-btn,
.kyc-banner-action {
    color: #f7fbff !important;
    border-color: rgba(167, 190, 214, 0.24) !important;
    background: rgba(10, 30, 52, 0.82) !important;
}

.copy-address-btn:hover,
.support-view-details-btn:hover,
.kyc-banner-action:hover {
    background: var(--secondary-color) !important;
    color: #07131f !important;
}

.transaction-history-table .trades-table,
.transaction-history-table {
    border-radius: 20px;
}

.transaction-history-table p {
    color: var(--text-muted);
    margin: 0 0 14px;
}

.profile-benefits .benefit-card p:last-child {
    margin-bottom: 0;
}

.milestone-item.completed {
    border-color: rgba(92, 213, 167, 0.18);
}

.milestone-state {
    min-width: 90px;
    text-align: right;
}

.kyc-persistent-banner .btn-secondary {
    flex-shrink: 0;
}

.admin-wrapper,
.admin-main-content,
.admin-content {
    background: var(--background-accent);
}

.admin-header,
.admin-sidebar,
.admin-content-inner,
.admin-content form,
.admin-content .trades-table,
.admin-content table,
.admin-ticket-details,
.admin-chat-messages {
    color: var(--text-color);
}

.admin-header {
    background: rgba(8, 23, 43, 0.88);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
}

.admin-header-right span {
    color: var(--text-color);
}

.admin-menu a,
.admin-logo h3 {
    color: #f4f8fc;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: rgba(11, 138, 137, 0.18);
}

.admin-content-inner {
    border-radius: 20px;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.admin-support-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 24px;
    min-height: 70vh;
}

.admin-support-sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.admin-ticket-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.admin-ticket-list-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    background: rgba(7, 19, 31, 0.6);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.admin-ticket-list-item:hover {
    background: rgba(11, 138, 137, 0.08);
    border-color: rgba(11, 138, 137, 0.24);
    transform: translateY(-1px);
}

.admin-support-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-ticket-details,
.admin-chat-messages {
    background: rgba(7, 19, 31, 0.76);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.admin-chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.admin-chat-input-row input {
    width: 100%;
}

.btn-danger {
    background: linear-gradient(135deg, #9f3047 0%, #c35269 100%);
    border: none;
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #88283d 0%, #a8475b 100%);
}

@media (max-width: 1100px) {
    .dashboard-shell .dashboard-content {
        grid-template-columns: 1fr;
    }

    .dashboard-shell .carousel-track {
        grid-auto-columns: minmax(240px, 260px);
    }
}

@media (max-width: 900px) {
    .admin-support-layout {
        grid-template-columns: 1fr;
    }

    .admin-support-sidebar {
        border-right: 0;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .dashboard-trades-table table,
    .transaction-history-table table,
    .support-ticket-table table,
    .admin-table-shell table,
    .admin-content table {
        min-width: 640px;
    }

    .admin-chat-input-row {
        grid-template-columns: 1fr;
    }
}

.trading-container {
    display: grid;
    gap: 24px;
}

.trading-header {
    align-items: stretch;
}

.trading-header h1 {
    margin: 0;
}

.trading-overview-band {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 20px;
    align-items: stretch;
}

.trading-overview-copy,
.trading-balance-carousel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
}

.trading-overview-copy {
    padding: 28px;
    display: grid;
    align-content: center;
    gap: 12px;
}

.trading-overview-copy h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.15;
}

.trading-kicker {
    margin: 0;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: #92e4dc;
}

.trading-balance-carousel {
    padding: 18px 0;
    overflow: hidden;
    position: relative;
}

.trading-balance-carousel::before,
.trading-balance-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 52px;
    z-index: 2;
    pointer-events: none;
}

.trading-balance-carousel::before {
    left: 0;
    background: linear-gradient(90deg, rgba(7, 19, 31, 0.96), rgba(7, 19, 31, 0));
}

.trading-balance-carousel::after {
    right: 0;
    background: linear-gradient(270deg, rgba(7, 19, 31, 0.96), rgba(7, 19, 31, 0));
}

.auto-carousel .carousel-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: seamlessCarousel var(--carousel-duration, 32s) linear infinite;
    will-change: transform;
}

.auto-carousel:hover .carousel-track {
    animation-play-state: paused;
}

.trading-balance-card {
    min-width: 230px;
    margin: 0;
}

.trading-main {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
    gap: 24px;
    align-items: start;
}

.chart-section {
    min-width: 0;
    padding: 24px;
    border-radius: 24px;
}

.chart-header {
    margin-bottom: 16px;
}

.chart-container {
    min-height: 420px;
}

.trade-panel {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.trade-form,
.active-trades {
    padding: 24px;
    border-radius: 24px;
}

.trade-type-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.trade-preview {
    padding: 18px 20px;
    display: grid;
    gap: 12px;
}

.preview-item {
    gap: 12px;
    align-items: center;
}

.preview-item span:last-child {
    font-weight: 700;
}

#activeTradesList {
    display: grid;
    gap: 14px;
}

.trade-item {
    padding: 18px;
}

.trade-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-hamburger,
.admin-nav-close,
.admin-nav-backdrop {
    display: none;
}

.admin-sidebar {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes seamlessCarousel {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-50% - 8px));
    }
}

@media (max-width: 1100px) {
    .trading-overview-band,
    .trading-main {
        grid-template-columns: 1fr;
    }

    .chart-container {
        min-height: 340px;
    }
}

@media (max-width: 900px) {
    .admin-hamburger {
        display: inline-flex;
        position: fixed;
        top: 18px;
        left: 18px;
        z-index: 1600;
        width: 46px;
        height: 46px;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        background: rgba(8, 23, 43, 0.92);
        color: #f4f8fc;
        box-shadow: var(--shadow-soft);
    }

    .admin-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(3, 10, 18, 0.46);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1500;
    }

    .admin-nav-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(320px, 84vw);
        height: 100vh;
        padding: 72px 18px 24px;
        z-index: 1550;
        transform: translateX(-100%);
        overflow-y: auto;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-nav-close {
        display: inline-flex;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.06);
        color: #f4f8fc;
        font-size: 1.6rem;
    }

    .admin-wrapper {
        display: block;
    }

    .admin-main-content {
        margin-left: 0 !important;
    }

    .admin-header {
        padding-left: 76px;
    }

    body.admin-drawer-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .trading-container {
        gap: 18px;
    }

    .trading-overview-copy,
    .chart-section,
    .trade-form,
    .active-trades {
        padding: 20px;
    }

    .trading-balance-card {
        min-width: 210px;
    }

    .trade-details {
        grid-template-columns: 1fr;
    }

    .preview-item {
        grid-template-columns: 1fr auto;
    }
}

.dashboard-shell {
    display: grid;
    gap: 24px;
}

.dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 0;
}

.dashboard-header h1 {
    margin: 0;
}

.dashboard-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 24px;
    align-items: stretch;
}

.dashboard-balance-summary,
.dashboard-metrics-panel,
.recent-trades-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.dashboard-balance-summary,
.dashboard-metrics-panel {
    padding: 24px;
}

.dashboard-section-heading,
.dashboard-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-panel-heading {
    display: grid;
    gap: 6px;
}

.dashboard-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    color: #92e4dc;
    font-weight: 700;
}

.dashboard-section-heading h2,
.dashboard-panel-heading h2 {
    margin: 4px 0 0;
}

.dashboard-balance-summary .total-balance {
    margin-top: 0;
    min-width: 220px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(7, 19, 31, 0.82);
    border: 1px solid rgba(167, 190, 214, 0.12);
}

.dashboard-balance-carousel {
    padding: 18px 0;
    overflow: hidden;
    position: relative;
    min-height: 206px;
}

.dashboard-balance-carousel::before,
.dashboard-balance-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 54px;
    z-index: 2;
    pointer-events: none;
}

.dashboard-balance-carousel::before {
    left: 0;
    background: linear-gradient(90deg, rgba(7, 19, 31, 0.98), rgba(7, 19, 31, 0));
}

.dashboard-balance-carousel::after {
    right: 0;
    background: linear-gradient(270deg, rgba(7, 19, 31, 0.98), rgba(7, 19, 31, 0));
}

.dashboard-balance-carousel .carousel-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: seamlessCarousel var(--carousel-duration, 36s) linear infinite;
    will-change: transform;
}

.dashboard-balance-card {
    min-width: 240px;
    margin: 0;
}

.dashboard-metrics-panel .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.recent-trades-section {
    padding: 24px;
}

.recent-trades-section h2 {
    margin: 0 0 18px;
}

.dashboard-trades-table {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.dashboard-trades-table table {
    width: 100%;
    min-width: 920px;
    table-layout: fixed;
    font-size: 0.95rem;
}

.dashboard-trades-table th,
.dashboard-trades-table td {
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.35;
    white-space: nowrap;
    word-break: normal;
}

.dashboard-trades-table th:nth-child(1),
.dashboard-trades-table td:nth-child(1) {
    width: 72px;
}

.dashboard-trades-table th:nth-child(2),
.dashboard-trades-table td:nth-child(2) {
    width: 88px;
}

.dashboard-trades-table th:nth-child(3),
.dashboard-trades-table td:nth-child(3) {
    width: 118px;
}

.dashboard-trades-table th:nth-child(4),
.dashboard-trades-table td:nth-child(4),
.dashboard-trades-table th:nth-child(5),
.dashboard-trades-table td:nth-child(5) {
    width: 108px;
}

.dashboard-trades-table th:nth-child(6),
.dashboard-trades-table td:nth-child(6) {
    width: 96px;
}

.dashboard-trades-table th:nth-child(7),
.dashboard-trades-table td:nth-child(7) {
    width: 92px;
}

.dashboard-trades-table th:nth-child(8),
.dashboard-trades-table td:nth-child(8) {
    width: 118px;
}

.dashboard-trades-table th:nth-child(9),
.dashboard-trades-table td:nth-child(9) {
    width: 148px;
}

.dashboard-trades-table tbody tr:hover {
    background: rgba(11, 138, 137, 0.08);
}

@media (max-width: 1100px) {
    .dashboard-overview-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics-panel .dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        grid-template-columns: 1fr;
    }

    .dashboard-balance-summary,
    .dashboard-metrics-panel,
    .recent-trades-section {
        padding: 20px;
    }

    .dashboard-section-heading {
        display: grid;
    }

    .dashboard-balance-card {
        min-width: 224px;
    }

    .dashboard-metrics-panel .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-trades-table table {
        min-width: 920px;
        font-size: 0.95rem;
    }

    .dashboard-trades-table th,
    .dashboard-trades-table td {
        font-size: 0.95rem;
    }
}

/* Page-level responsiveness and polish */
.dashboard-metrics,
.profile-highlights {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.metric-label {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.metric-card h3 {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.dashboard-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.balance-carousel {
    height: auto;
    min-height: 190px;
}

.balance-carousel .carousel-track {
    gap: 12px;
}

.trade-panel {
    min-width: 0;
}

.trade-preview .preview-item span:last-child {
    text-align: right;
}

.trades-table {
    overflow-x: auto;
}

.trades-table table {
    min-width: 780px;
}

.transaction-history-table .tx-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 39, 69, 0.08);
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 600;
}

.transaction-history-table .status-pending,
.transaction-history-table .status-completed,
.transaction-history-table .status-failed {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.transaction-history-table .status-completed {
    background: rgba(22, 131, 109, 0.14);
    color: #0f7d67;
}

.transaction-history-table .status-pending {
    background: rgba(216, 163, 77, 0.16);
    color: #8f6718;
}

.transaction-history-table .status-failed {
    background: rgba(196, 81, 95, 0.16);
    color: #a83947;
}

.support-form-section form,
.support-tickets-section .trades-table,
.profile-card {
    padding: 22px;
}

.support-chat-shell {
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}

.support-chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(15, 39, 69, 0.03);
}

.support-chat-compose {
    display: flex;
    gap: 10px;
}

.support-chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(248, 251, 255, 0.96);
}

.auth-helper-text {
    margin-top: 18px;
    text-align: center;
    color: var(--text-muted);
}

.auth-helper-text a {
    font-weight: 700;
}

#assetTrendChart {
    width: 100% !important;
    height: 100% !important;
}

.action-card .chart-container {
    min-height: 320px;
    height: clamp(320px, 45vh, 460px);
}

body.dark-mode .transaction-history-table .tx-type-badge {
    background: rgba(160, 187, 214, 0.14);
    color: #dce8f5;
}

body.dark-mode .support-chat-shell,
body.dark-mode .support-chat-messages,
body.dark-mode .support-chat-input {
    background: rgba(7, 19, 31, 0.9);
    border-color: rgba(164, 189, 217, 0.16);
    color: var(--text-color);
}

body.dark-mode .transaction-history-table .status-completed {
    color: #9ef3d0;
}

body.dark-mode .transaction-history-table .status-pending {
    color: #ffd38a;
}

body.dark-mode .transaction-history-table .status-failed {
    color: #ffb4be;
}

@media (max-width: 1200px) {
    .dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .profile-highlights {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-metrics,
    .profile-highlights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trading-main {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .trading-header,
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .user-balance,
    .user-info {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .dashboard-metrics,
    .profile-highlights {
        grid-template-columns: 1fr;
    }

    .support-chat-compose {
        flex-direction: column;
    }

    .trades-table table {
        min-width: 640px;
    }

    .action-card .chart-container {
        min-height: 260px;
        height: 300px;
    }
}

/* Navigation drawer, persistent KYC banner, and final responsive overrides */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 19, 33, 0.58);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 1400;
}

.nav-drawer {
    position: relative;
}

.nav-close {
    display: none;
}

.kyc-persistent-banner {
    position: sticky;
    top: 80px;
    z-index: 1200;
    margin: 8px auto 0;
    width: min(1200px, calc(100% - 32px));
    border: 1px solid rgba(216, 163, 77, 0.3);
    background: rgba(255, 248, 230, 0.96);
    box-shadow: 0 8px 24px rgba(15, 39, 69, 0.08);
}

body.dark-mode .kyc-persistent-banner {
    background: rgba(34, 27, 12, 0.95);
    border-color: rgba(216, 163, 77, 0.35);
}

.dashboard-shell .balance-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
}

.dashboard-shell .carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    width: 100%;
}

.dashboard-shell .balance-card-carousel {
    min-width: 0;
    margin: 0;
}

.dashboard-shell .recent-trades-section .trades-table {
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.dashboard-shell .recent-trades-section table {
    min-width: 860px;
}

.dashboard-shell .recent-trades-section th {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-shell .recent-trades-section td {
    vertical-align: middle;
}

.profile-benefits .benefit-card {
    padding: 22px;
}

.benefit-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0;
}

.benefit-subtext {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.milestone-list {
    display: grid;
    gap: 10px;
}

.milestone-item {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.52;
    background: rgba(15, 39, 69, 0.03);
}

.milestone-item.reached {
    opacity: 0.78;
}

.milestone-item.current {
    opacity: 1;
    border-color: rgba(11, 138, 137, 0.45);
    box-shadow: 0 8px 20px rgba(11, 138, 137, 0.16);
    background: rgba(11, 138, 137, 0.1);
}

.milestone-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.milestone-state {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.benefit-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* Landing page dark-mode compliance */
body.dark-mode .features,
body.dark-mode .trading-section,
body.dark-mode .how-it-works,
body.dark-mode .testimonials,
body.dark-mode .contact {
    background: transparent;
}

body.dark-mode .feature-card,
body.dark-mode .how-it-works-card,
body.dark-mode .testimonial-card,
body.dark-mode .contact form,
body.dark-mode .stat-card {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .stat-card {
    background: linear-gradient(135deg, #10233f 0%, #143152 100%);
}

body.dark-mode .contact input,
body.dark-mode .contact textarea {
    background: rgba(7, 19, 31, 0.9);
    color: var(--text-color);
    border-color: rgba(164, 189, 217, 0.16);
}

@media (max-width: 900px) {
    .dashboard-shell .carousel-track {
        display: flex;
        min-width: max-content;
    }

    .dashboard-shell .balance-card-carousel {
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .nav-drawer {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(320px, 86vw);
        background: rgba(14, 30, 52, 0.95);
        border-left: 1px solid rgba(255, 255, 255, 0.14);
        transform: translateX(100%);
        transition: transform 0.32s ease;
        z-index: 1500;
        padding: 18px 18px 24px;
    }

    .nav-close {
        display: block;
        margin-left: auto;
        margin-bottom: 8px;
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 2rem;
        line-height: 1;
        cursor: pointer;
    }

    .nav-drawer .nav-menu {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        background: transparent;
        border: 0;
        box-shadow: none;
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.24s ease 0.1s, transform 0.24s ease 0.1s;
    }

    .drawer-open .nav-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    .drawer-open .nav-drawer.active {
        transform: translateX(0);
    }

    .drawer-open .nav-drawer.active .nav-menu {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-drawer .nav-menu a {
        color: #eef5ff;
    }

    .nav-drawer .nav-menu .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .kyc-persistent-banner {
        width: min(100%, calc(100% - 24px));
        top: 74px;
    }

    .dashboard-shell .recent-trades-section table {
        min-width: 680px;
    }
}

/* CryptoCrest refresh */
:root {
    --background-color: #f4f7fb;
    --background-accent: radial-gradient(circle at top left, rgba(11, 138, 137, 0.16), transparent 30%), radial-gradient(circle at top right, rgba(11, 39, 69, 0.14), transparent 28%), linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
    --surface-color: rgba(255, 255, 255, 0.92);
    --surface-muted: #e9eff5;
    --surface-strong: #0f2745;
    --card-bg: rgba(255, 255, 255, 0.94);
    --text-color: #10233f;
    --text-muted: #5e728d;
    --border-color: rgba(16, 35, 63, 0.12);
    --primary-color: #0b8a89;
    --primary-strong: #0a6f73;
    --secondary-color: #0f2745;
    --accent-color: #d8a34d;
    --danger-color: #c4515f;
    --success-color: #16836d;
    --shadow-soft: 0 18px 45px rgba(15, 39, 69, 0.09);
    --shadow-strong: 0 24px 55px rgba(8, 23, 43, 0.16);
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text-color);
    background: var(--background-accent);
}

h1, h2, h3, h4, .nav-logo h2, .admin-logo h3 {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
    letter-spacing: -0.02em;
    color: var(--secondary-color);
}

p, li, label, input, select, textarea, button, a, span {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
}

.navbar {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(16, 35, 63, 0.08);
    box-shadow: 0 14px 32px rgba(15, 39, 69, 0.08);
}

.nav-container {
    max-width: 1280px;
}

.nav-logo h2 {
    color: var(--secondary-color);
}

.nav-menu a {
    color: var(--text-color);
}

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

.btn-primary,
.btn-auth,
.btn-success {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0c6db2 100%);
    border: none;
    color: #fff;
    box-shadow: 0 16px 28px rgba(11, 138, 137, 0.22);
}

.btn-primary:hover,
.btn-auth:hover,
.btn-success:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, #0a5a95 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(15, 39, 69, 0.04);
    border: 1px solid rgba(15, 39, 69, 0.12);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.hero {
    background: radial-gradient(circle at top left, rgba(216, 163, 77, 0.22), transparent 24%), radial-gradient(circle at 80% 15%, rgba(11, 138, 137, 0.26), transparent 28%), linear-gradient(135deg, #08172b 0%, #0f2745 54%, #153b63 100%);
    padding: 164px 0 112px;
}

.hero-container,
.dashboard-content,
.trading-main,
.footer-content,
.features-grid,
.how-it-works-grid,
.testimonials-grid,
.balance-grid {
    gap: 24px;
}

.hero-content h1 {
    font-size: clamp(2.8rem, 5vw, 4.6rem);
    max-width: 12ch;
    margin-bottom: 18px;
}

.hero-content p {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #d5e8ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-image,
.feature-card,
.stat-card,
.how-it-works-card,
.testimonial-card,
.auth-card,
.profile-card,
.action-card,
.trades-table,
.chart-section,
.trade-panel,
.trade-form,
.active-trades,
.admin-content-inner,
.balance-card,
.balance-card-carousel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.hero-image {
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.12);
}

.price-item,
.preview-item,
.daily-pnl,
.balance-header,
.balance-amount {
    color: #f3f8ff;
}

.crypto-prices .price-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.features,
.trading-section,
.how-it-works,
.testimonials,
.contact,
.dashboard-container,
.trading-container,
.admin-content {
    padding-top: 24px;
}

.feature-card,
.how-it-works-card,
.testimonial-card,
.stat-card {
    border-radius: 24px;
}

.feature-card,
.how-it-works-card,
.testimonial-card {
    padding: 28px;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1c4b73 100%);
}

.contact form,
.admin-content form,
.profile-card,
.action-card,
.trade-form,
.active-trades {
    border-radius: 24px;
}

.contact form,
.admin-content form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

input,
select,
textarea,
.form-group input,
.form-group select,
.admin-content .form-group input[type="text"],
.admin-content .form-group input[type="number"],
.admin-content .form-group input[type="email"],
.admin-content .form-group select {
    border-radius: 14px;
    border: 1px solid rgba(16, 35, 63, 0.12);
    background: rgba(248, 251, 255, 0.96);
    color: var(--text-color);
}

input:focus,
select:focus,
textarea:focus,
.form-group input:focus,
.form-group select:focus {
    border-color: rgba(11, 138, 137, 0.52);
    box-shadow: 0 0 0 4px rgba(11, 138, 137, 0.14);
}

.auth-container {
    padding: 42px 20px 72px;
}

.auth-card {
    overflow: hidden;
    border-radius: 28px;
}

.auth-header {
    background: linear-gradient(135deg, #0f2745 0%, #15456f 100%);
    color: #fff;
}

.auth-header h2,
.auth-header p,
.auth-icon {
    color: #fff;
}

.auth-icon {
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
}

.verification-message,
.resend-verification-form,
.inline-verification-form {
    margin-top: 18px;
}

.verification-message {
    background: rgba(11, 138, 137, 0.08);
    border: 1px solid rgba(11, 138, 137, 0.16);
    color: var(--secondary-color);
}

.resend-verification-form {
    padding: 20px;
    border-radius: 20px;
    background: rgba(15, 39, 69, 0.04);
    border: 1px solid rgba(15, 39, 69, 0.08);
}

.inline-verification-form {
    display: inline-flex;
    margin-left: 12px;
    vertical-align: middle;
}

.dashboard-header,
.trading-header,
.admin-header {
    background: transparent;
}

.dashboard-header,
.trading-header {
    margin-bottom: 24px;
}

.total-balance span,
.balance-total-usd span {
    color: var(--secondary-color);
    font-weight: 800;
}

.trades-table {
    border-radius: 24px;
    overflow-x: auto;
    overflow-y: hidden;
}

.trades-table table {
    min-width: 720px;
}

.trades-table th {
    background: rgba(15, 39, 69, 0.05);
    color: var(--secondary-color);
}

.trades-table tbody tr:hover {
    background: rgba(11, 138, 137, 0.04);
}

.admin-sidebar {
    background: linear-gradient(180deg, #08172b 0%, #10233f 100%);
    box-shadow: 14px 0 36px rgba(8, 23, 43, 0.18);
}

.admin-menu a:hover,
.admin-menu a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #92e4dc;
}

.admin-content {
    background: transparent;
}

.notification {
    border-radius: 18px;
    box-shadow: var(--shadow-strong);
}

.badge {
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}

.footer-content {
    padding: 32px 0 24px;
}

.footer-section p,
.footer-section li a,
.footer-bottom p {
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .hero-container,
    .dashboard-content,
    .trading-main,
    .footer-content {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-image {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .main-content-padding {
        padding-top: 88px;
    }

    .nav-container {
        height: auto;
        min-height: 70px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-menu {
        padding: 16px 20px 22px;
        gap: 12px;
        box-shadow: 0 22px 38px rgba(15, 39, 69, 0.12);
    }

    .hero {
        padding: 136px 0 84px;
    }

    .hero-buttons,
    .auth-options,
    .admin-header-right {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary,
    .btn-auth {
        width: 100%;
        justify-content: center;
    }

    .dashboard-header,
    .trading-header,
    .admin-header,
    .admin-header-right {
        gap: 12px;
    }

    .balance-grid,
    .features-grid,
    .how-it-works-grid,
    .testimonials-grid,
    .trading-stats {
        grid-template-columns: 1fr;
    }

    #notification-container {
        left: 16px;
        right: 16px;
        top: 84px;
    }

    .notification {
        min-width: 0;
        max-width: 100%;
    }

    .inline-verification-form {
        display: flex;
        margin-left: 0;
        margin-top: 12px;
    }
}

/* Unified theme and layout fixes */
body.light-mode {
    color-scheme: light;
}

body.dark-mode {
    color-scheme: dark;
    --background-color: #07131f;
    --background-accent: radial-gradient(circle at top left, rgba(11, 138, 137, 0.18), transparent 30%), radial-gradient(circle at top right, rgba(216, 163, 77, 0.12), transparent 25%), linear-gradient(180deg, #07131f 0%, #0b1828 100%);
    --surface-color: rgba(13, 24, 38, 0.92);
    --surface-muted: rgba(17, 31, 49, 0.95);
    --surface-strong: #dfe9f5;
    --card-bg: rgba(11, 24, 40, 0.94);
    --text-color: #e3edf7;
    --text-muted: #9bb0c8;
    --border-color: rgba(164, 189, 217, 0.14);
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.32);
    --shadow-strong: 0 24px 55px rgba(0, 0, 0, 0.42);
}

body.dark-mode,
body.dark-mode p,
body.dark-mode li,
body.dark-mode label,
body.dark-mode span,
body.dark-mode td,
body.dark-mode th {
    color: var(--text-color);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode strong {
    color: #f5f8fc;
}

body.dark-mode .navbar,
body.dark-mode .hero-image,
body.dark-mode .feature-card,
body.dark-mode .how-it-works-card,
body.dark-mode .testimonial-card,
body.dark-mode .auth-card,
body.dark-mode .profile-card,
body.dark-mode .action-card,
body.dark-mode .trades-table,
body.dark-mode .chart-section,
body.dark-mode .trade-panel,
body.dark-mode .trade-form,
body.dark-mode .active-trades,
body.dark-mode .admin-content-inner,
body.dark-mode .balance-card,
body.dark-mode .balance-card-carousel,
body.dark-mode .contact form,
body.dark-mode .admin-content form,
body.dark-mode .modal-content,
body.dark-mode .resend-verification-form {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-soft);
}

body.dark-mode .nav-menu,
body.dark-mode .footer-content,
body.dark-mode .footer-bottom {
    background: transparent;
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section li a,
body.dark-mode .footer-bottom p {
    color: var(--text-muted);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: rgba(7, 19, 31, 0.9);
    color: var(--text-color);
    border-color: rgba(164, 189, 217, 0.16);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #7991ac;
}

body.dark-mode .admin-content input,
body.dark-mode .admin-content select,
body.dark-mode .admin-content textarea,
body.dark-mode .admin-content .form-group input,
body.dark-mode .admin-content .form-group select,
body.dark-mode .admin-content .form-group textarea,
body.dark-mode .admin-management-tools input,
body.dark-mode .admin-management-tools select {
    background: #11263d;
    color: #f6fbff;
    border: 1px solid rgba(138, 180, 222, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.dark-mode .admin-content input::placeholder,
body.dark-mode .admin-content textarea::placeholder,
body.dark-mode .admin-management-tools input::placeholder {
    color: #a8bfd9;
}

body.dark-mode .admin-content input:disabled,
body.dark-mode .admin-content select:disabled,
body.dark-mode .admin-content textarea:disabled {
    background: #0b1a2a;
    color: #dbe7f3;
    opacity: 1;
}

body.dark-mode .admin-content input:focus,
body.dark-mode .admin-content select:focus,
body.dark-mode .admin-content textarea:focus,
body.dark-mode .admin-management-tools input:focus,
body.dark-mode .admin-management-tools select:focus {
    border-color: rgba(66, 211, 183, 0.7);
    box-shadow: 0 0 0 3px rgba(66, 211, 183, 0.16);
}

body.dark-mode .trade-preview,
body.dark-mode .trade-item,
body.dark-mode .verification-message,
body.dark-mode .notification,
body.dark-mode .modal-ticket-description,
body.dark-mode #kyc-upload-section {
    background: rgba(7, 19, 31, 0.82);
    border-color: rgba(164, 189, 217, 0.12);
}

.hero-image .price-item,
.hero-image .price-item span,
.hero-image .price,
.hero-image h3 {
    color: #f3f8ff;
}

.trade-preview .preview-item,
.trade-preview .preview-item span,
.balance-card .balance-header,
.balance-card .balance-header h3,
.balance-card .balance-amount,
.balance-card .balance-amount span,
.balance-card-carousel .balance-header,
.balance-card-carousel .balance-header h3,
.balance-card-carousel .balance-amount,
.balance-card-carousel .balance-amount span,
.balance-card-carousel .daily-pnl,
.balance-card-carousel .daily-pnl span {
    color: var(--text-color);
}

.daily-pnl .pnl-positive,
.daily-pnl .pnl-negative,
.trade-preview #estimatedPayout,
.trade-preview #estimatedLoss {
    font-weight: 700;
}

.trade-preview {
    background: rgba(15, 39, 69, 0.04);
    border: 1px solid rgba(15, 39, 69, 0.08);
    border-radius: 20px;
}

.trade-item {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    background: rgba(15, 39, 69, 0.03);
}

.trade-details {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.section-spacer-xs {
    margin-top: 10px;
}

.section-spacer-sm {
    margin-top: 20px;
}

.section-spacer-md {
    margin-top: 30px;
}

.section-spacer-lg {
    margin-top: 50px;
}

.btn-compact {
    padding: 6px 12px;
    font-size: 0.9rem;
    margin-left: 5px;
}

.table-empty {
    margin-top: 14px;
    color: var(--text-muted);
}

.is-hidden {
    display: none;
}

.modal-ticket-description {
    white-space: pre-wrap;
    background: rgba(15, 39, 69, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    color: var(--text-color);
}

.kyc-upload-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.notification {
    align-items: flex-start;
    gap: 14px;
}

.notification-body {
    display: grid;
    gap: 4px;
    flex: 1;
}

.notification-title {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
}

.notification-text {
    line-height: 1.45;
}

.notification-close {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

.dashboard-shell,
.trading-container,
.container {
    width: min(1200px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.support-form-section form,
.profile-card,
.kyc-section .profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: 24px;
}

body.dark-mode .status-settled {
    color: #8fe0bf;
}

body.dark-mode .status-active {
    background: rgba(22, 131, 109, 0.15);
    color: #9ef3d0;
}

body.dark-mode .status-inactive,
body.dark-mode .status-cancelled {
    background: rgba(196, 81, 95, 0.14);
    color: #ffb4be;
}

body.dark-mode .trade-type-buy {
    color: #92e4dc;
}

body.dark-mode .trade-type-sell {
    color: #ffb4be;
}

body.dark-mode .trades-table th {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .trades-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .trades-table tbody tr:hover {
    background: rgba(11, 138, 137, 0.08);
}

@media (max-width: 900px) {
    .grid-two {
        grid-template-columns: 1fr;
    }

    .btn-compact {
        display: inline-flex;
        margin-top: 8px;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-shell,
    .trading-container,
    .container {
        width: min(100%, calc(100% - 24px));
    }

    .trade-preview,
    .trade-item,
    .support-form-section form,
    .profile-card,
    .action-card {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.5s ease-out;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}
.close-modal-btn:hover {
    color: #333;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
