/* MLM Pro Network - Modern Aesthetic Design */

:root {
    /* Sophisticated Color Palette - Deep Blues with Gold Accents */
    --primary: #0A2463;
    --primary-dark: #051533;
    --primary-light: #1E3A8A;
    --accent: #D4AF37;
    --accent-dark: #B8960F;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border: #E5E7EB;
    --shadow: rgba(10, 36, 99, 0.1);
    --shadow-lg: rgba(10, 36, 99, 0.15);
}

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Unique Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 0;
    box-shadow: 0 4px 20px var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--accent);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 70px;
}

.navbar-brand {
    font-family: 'Georgia', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bg-primary);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand::before {
    content: '◆';
    color: var(--accent);
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-menu a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-menu a:hover::after {
    width: 80%;
}

/* Container System */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card Component with Elevated Design */
.card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-lg);
}

.card-header {
    border-bottom: 2px solid var(--bg-tertiary);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(10, 36, 99, 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230A2463' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

/* Button System with Elevated Styles */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 36, 99, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 36, 99, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

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

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

.btn-block {
    width: 100%;
}

/* Stats Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: var(--accent);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-lg);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Georgia', serif;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.5rem;
}

/* Binary Tree Visualization */
.tree-container {
    padding: 2rem;
    overflow-x: auto;
}

.tree {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: center;
}

.tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s;
}

.tree li::before,
.tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--primary);
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--primary);
}

.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

.tree li:first-child::before,
.tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid var(--primary);
    border-radius: 0 8px 0 0;
}

.tree li:first-child::after {
    border-radius: 8px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--primary);
    width: 0;
    height: 20px;
}

.tree-node {
    border: 2px solid var(--primary);
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    background: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    min-width: 120px;
}

.tree-node:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--shadow-lg);
}

.tree-node.left {
    border-color: var(--success);
}

.tree-node.right {
    border-color: var(--warning);
}

.tree-username {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.tree-position {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Table Styling */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge System */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.badge-warning {
    background: var(--warning);
    color: white;
}

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

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

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #B45309;
}

.alert-info {
    background: rgba(10, 36, 99, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    
    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}
