/* TRON Energy Bot Admin CSS */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Exchange Prices Styles */
.exchange-prices {
    padding: 20px;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.price-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.price-item.standard-cost {
    border-color: #28a745;
    background: #f8fff9;
}

.price-item.available {
    border-color: #007bff;
    background: #f8fffe;
}

.price-item.unavailable {
    border-color: #dc3545;
    background: #fdf8f8;
    opacity: 0.6;
}

.price-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 18px;
    font-weight: bold;
    color: #212529;
    margin-bottom: 5px;
}

.price-item.standard-cost .price-value {
    color: #28a745;
}

.price-item.available .price-value {
    color: #007bff;
}

.price-item.unavailable .price-value {
    color: #dc3545;
}

.price-detail {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Exchange Balances Styles */
.exchange-balances {
    padding: 20px;
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.balance-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.balance-item.available {
    border-color: #28a745;
    background: #f8fff9;
}

.balance-item.unavailable {
    border-color: #ffc107;
    background: #fffbf0;
}

.balance-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-size: 18px;
    font-weight: bold;
    color: #212529;
    margin-bottom: 5px;
}

.balance-item.available .balance-value {
    color: #28a745;
}

.balance-item.unavailable .balance-value {
    color: #856404;
}

.balance-status {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.balance-updated {
    font-size: 10px;
    color: #adb5bd;
    font-style: italic;
}

.no-balances {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.05);
    min-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.login-form h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.login-form h2 {
    color: #666;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Admin Container */
.admin-container {
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* Left Sidebar Navigation */
.admin-nav {
    width: 280px;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

/* Sidebar Header */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h1 {
    color: white;
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.sidebar-header .subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    text-align: center;
    margin-top: 4px;
}

/* Main Content Area */
.admin-main-area {
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.admin-header {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-title {
    color: #2d3748;
    font-size: 1.6em;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    color: #4a5568;
    font-weight: 500;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 14px;
}

.username::before {
    content: '👤 ';
    margin-right: 4px;
}

.nav-list {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    font-weight: 500;
    font-size: 15px;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

/* Navigation Icons */
.nav-link::before {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f5f5f5;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

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

.section-header h2 {
    color: #333;
    font-size: 1.8em;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control,
.search-input,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fafbfc;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus,
.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Special styling for login form inputs */
.login-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

.login-form .form-group label {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #f7fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    position: relative;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
    color: #a0aec0;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-text {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Special styling for login form button */
.login-form .btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-form .btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-form .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

/* Cards and Stats */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.metric-change {
    font-size: 12px;
    color: #28a745;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h4 {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
}

.chart-container canvas {
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e1e5e9;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed,
.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed,
.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

/* Pool Management */
.pool-overview {
    margin-bottom: 30px;
}

.pool-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.pool-stat {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pool-stat h4 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.pool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pool-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pool-card h4 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pool-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s ease;
}

.pool-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
}

.pool-details span {
    display: flex;
    justify-content: space-between;
}

/* Settings */
.settings-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e1e5e9;
}

.settings-group:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.settings-group h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.settings-actions {
    text-align: center;
    padding-top: 20px;
}

/* Activity List */
.activity-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.activity-description {
    color: #666;
    font-size: 12px;
}

.activity-time {
    color: #999;
    font-size: 11px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e5e9;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 15px 20px;
    max-width: 350px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-message {
    color: #666;
    font-size: 13px;
}

/* Error Messages */
.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Loading States */
.loading {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-nav {
        position: static;
        width: 100%;
        height: auto;
        background: linear-gradient(90deg, #2d3748 0%, #1a202c 100%);
    }

    .admin-main-area {
        margin-left: 0;
    }

    .sidebar-header {
        padding: 16px 20px;
    }

    .sidebar-header h1 {
        font-size: 1.2em;
    }

    .nav-list {
        padding: 10px 0;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
    }

    .nav-list li {
        flex-shrink: 0;
    }

    .nav-link {
        padding: 12px 16px;
        margin: 0 4px;
        border-radius: 6px;
        border-left: none;
        font-size: 14px;
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        background: rgba(102, 126, 234, 0.3);
        border-radius: 6px;
    }

    .admin-header {
        padding: 0 16px;
    }

    .header-content {
        height: 56px;
    }

    .header-title {
        font-size: 1.3em;
    }

    .username {
        font-size: 12px;
        padding: 6px 8px;
    }

    .admin-main {
        padding: 16px;
        min-height: calc(100vh - 56px - 80px);
    }

    .nav-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-link.active {
        border-left: none;
        border-bottom-color: #667eea;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .section-actions {
        justify-content: stretch;
    }

    .metrics-grid,
    .stats-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}

/* Loading Screen */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content p {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 500;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-muted {
    color: #6c757d;
}