/* ============================================
   GLOBAL STYLES - Phantom Trades
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #f39c12;
    --secondary-dark: #e67e22;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-gray: #f4f7f6;
    --border-color: #eee;
    --text-color: #333;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: var(--light-gray);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logo:hover {
    color: var(--primary-dark);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
    background: rgba(52, 152, 219, 0.1);
}

.logout-link {
    color: var(--danger-color);
    margin-left: 10px;
}

.logout-link:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.site-footer {
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 0.95em;
}

.footer-text {
    font-size: 0.85em;
    margin-top: 10px;
}

/* ============================================
   MAIN CONTENT CONTAINER
   ============================================ */

.container {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ============================================
   CARD STYLES
   ============================================ */

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    margin: 0 0 15px 0;
    color: var(--dark-color);
    font-size: 1.3em;
}

.card p {
    color: #636e72;
    font-size: 0.95em;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 20px;
}

.card .btn {
    align-self: center;
    margin-top: auto;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--primary-color);
    color: white;
}

.btn:hover {
    background: var(--primary-dark);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #219150;
}

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

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

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-admin {
    background: var(--secondary-color);
    color: white;
}

.btn-admin:hover {
    background: var(--secondary-dark);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.85em;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin: 30px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* ============================================
   TABLE STYLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: var(--dark-color);
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 0.85em;
    white-space: nowrap;
}

.table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

.table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ============================================
   ALERT STYLES
   ============================================ */

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 5px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #198754;
}

.alert-danger,
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #e74c3c;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #3498db;
}

/* ============================================
   HEADING STYLES
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.3em;
}

.page-title {
    margin-bottom: 10px;
}

.page-description {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 0.95em;
}

/* ============================================
   ADMIN CARD STYLES
   ============================================ */

.admin-card {
    border-top: 5px solid var(--secondary-color);
    background: #fffdf9;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

.text-muted {
    color: #7f8c8d;
}

.text-danger {
    color: var(--danger-color);
}

.text-success {
    color: var(--success-color);
}

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

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

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

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

.w-100 {
    width: 100%;
}

.shadow {
    box-shadow: var(--shadow-md);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 5px;
        width: 100%;
    }

    .nav-link {
        font-size: 0.9em;
        padding: 8px 12px;
    }

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

    .table {
        font-size: 0.85em;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    .container {
        padding: 0 15px;
    }
}

/* LOGIN PAGE SPECIFIC
   ============================================ */

.login-body {
    padding: 0;
    margin: 0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo-placeholder {
    width: 120px;
    height: 120px;
    background: var(--light-gray);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 0.9em;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.login-card .form-group input {
    margin-bottom: 15px;
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

.profile-form { 
    max-width: 600px; 
    margin: 30px auto; 
}

.form-section { 
    margin-top: 40px; 
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.form-section h3 { 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    margin-bottom: 20px;
}

/* ============================================
   POSITION COLORS
   ============================================ */

.pos {
    color: var(--success-color);
    font-weight: bold;
}

.neg {
    color: var(--danger-color);
    font-weight: bold;
}
