/**
 * System name: Trading Smart
 * Filename: style.css
 * Version: 1.0
 * Date: 2025-01-28
 * Folder: assets/css
 * Domain: tradingsmart.pro
 * Developer: Jim Tjernstroem, Vianke Ltd
 * Copyright Vianke Ltd 2025
 */

/* ==========================================================================
   RESET AND BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', Arial, sans-serif;
    background: #ffffff;
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a1a1a;
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.welcome-text h2 {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.welcome-text p {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
}

/* ==========================================================================
   NAVIGATION STYLES
   ========================================================================== */
nav {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0 2rem;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
}

.nav-item {
    padding: 1rem 0;
    color: #666;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

/* ==========================================================================
   MAIN LAYOUT
   ========================================================================== */
main {
    flex: 1;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

/* Auth page main */
main.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* ==========================================================================
   PAGE HEADERS
   ========================================================================== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
    font-weight: normal;
}

/* ==========================================================================
   GRIDS AND LAYOUTS
   ========================================================================== */
.dashboard-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-1x4 {
    grid-template-columns: repeat(4, 1fr);
}

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

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

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

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-mini {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-mini-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1a1a1a;
}

.stat-mini-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* ==========================================================================
   ICONS
   ========================================================================== */
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: #e3f2fd; }
.stat-icon.green { background: #e8f5e8; }
.stat-icon.orange { background: #fff3e0; }
.stat-icon.purple { background: #f3e5f5; }

.stat-info h3 {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1a1a1a;
}

.stat-trend {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #666;
    font-size: 0.9rem;
    font-weight: normal;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.2s ease;
    color: #1a1a1a;
}

.form-group input[type="password"] {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    padding: 0;
    margin-top: 0.75rem;
}

.password-toggle:hover {
    color: #1a1a1a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d2d2d;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.1);
}

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

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: #1a1a1a;
    color: white;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid #e5e5e5;
}

.btn-secondary:hover {
    border-color: #2d2d2d;
    background: #f5f5f5;
}

.btn-small {
    padding: 0;
    border: none;
    cursor: pointer;
    font-weight: normal;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 3px;
    font-size: 12px;
    color: white;
    vertical-align: middle;
}

.btn-approve, .btn-activate {
    background: #4caf50;
}

.btn-approve:hover, .btn-activate:hover {
    background: #45a049;
    transform: scale(1.2);
}

.btn-suspend {
    background: #f44336;
}

.btn-suspend:hover {
    background: #da190b;
    transform: scale(1.2);
}

.btn-edit {
    background: #2196f3;
}

.btn-edit:hover {
    background: #1976d2;
    transform: scale(1.2);
}

.btn-password {
    background: #ff9800;
}

.btn-password:hover {
    background: #f57c00;
    transform: scale(1.2);
}

.btn-add {
    background: #4caf50;
    color: white;
    padding: 0.5rem 1rem;
    width: auto;
    height: auto;
    font-size: 0.9rem;
    border-radius: 6px;
}

.btn-add:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 80px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -40px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 11px;
    pointer-events: none;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.logout-btn {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.action-btn {
    background: #f5f5f7;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #1a1a1a;
    color: white;
    transform: translateY(-2px);
}

.action-btn-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.2rem;
    font-weight: bold;
}

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

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafafa;
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th a {
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

th a:hover {
    color: #1a1a1a;
}

.sort-arrow {
    font-size: 0.8rem;
}

td {
    color: #1a1a1a;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* ==========================================================================
   BADGES AND STATUS
   ========================================================================== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-active {
    background: #e8f5e8;
    color: #4caf50;
}

.status-suspended {
    background: #ffebee;
    color: #f44336;
}

.role-badge {
    background: #1a1a1a;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin { background: #d32f2f; }
.role-badge.broker { background: #1976d2; }
.role-badge.agent { background: #388e3c; }
.role-badge.client { background: #7b1fa2; }

.profit-positive {
    color: #4caf50;
    font-weight: bold;
}

.profit-negative {
    color: #f44336;
    font-weight: bold;
}

.profit-neutral {
    color: #666;
}

/* ==========================================================================
   MESSAGES
   ========================================================================== */
.message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #363;
    border: 1px solid #cfc;
}

.message.info {
    background: #eef;
    color: #336;
    border: 1px solid #ccf;
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #999;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    color: #666;
    font-size: 0.9rem;
    font-weight: normal;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

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

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.toggle-form {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.toggle-form a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
}

.toggle-form a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    header, nav, main, footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    header, footer {
        padding: 1rem;
    }
}