/**
 * Dashboard and Landing Page Styles
 */

/* Landing Page */
.es-landing-page {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.es-landing-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.es-landing-content h1 {
    font-size: 3em;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.es-tagline {
    font-size: 1.3em;
    margin: 0 0 50px 0;
    opacity: 0.95;
}

.es-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.es-feature {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.es-feature:hover {
    transform: translateY(-5px);
}

.es-feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.es-feature h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.es-feature p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.6;
}

.es-landing-login {
    padding: 60px 20px;
    background: #f8f9fa;
}

.es-login-box {
    max-width: 450px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.es-login-box h2 {
    margin: 0 0 10px 0;
    text-align: center;
    color: #333;
}

.es-login-box > p {
    text-align: center;
    color: #666;
    margin: 0 0 30px 0;
}

.es-login-form {
    margin-top: 20px;
}

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

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

.es-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.es-input:focus {
    outline: none;
    border-color: #667eea;
}

.es-form-checkbox {
    display: flex;
    align-items: center;
}

.es-form-checkbox label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin: 0;
}

.es-form-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.es-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.es-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.es-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e8ed;
}

.es-btn-secondary:hover {
    background: #e9ecef;
}

.es-btn-block {
    width: 100%;
    display: block;
}

.es-login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.es-login-footer a {
    color: #667eea;
    text-decoration: none;
}

.es-login-footer a:hover {
    text-decoration: underline;
}

.es-login-footer .separator {
    margin: 0 10px;
    color: #ccc;
}

/* Dashboard Layout */
.es-dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

.es-dashboard-sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
}

.es-sidebar-header {
    padding: 30px 20px;
    background: #1a252f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.es-sidebar-header h2 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: white;
}

.es-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.es-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: 700;
    text-transform: uppercase;
}

.es-user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.es-user-details strong {
    font-size: 1em;
    margin-bottom: 4px;
}

.es-user-role {
    font-size: 0.85em;
    opacity: 0.7;
}

.es-sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.es-menu-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
}

.es-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.es-menu-item.es-active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left: 4px solid #667eea;
}

.es-menu-item .dashicons {
    margin-right: 12px;
    font-size: 20px;
}

.es-menu-text {
    font-size: 15px;
    font-weight: 500;
}

.es-sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.es-logout-link {
    display: flex;
    align-items: center;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.es-logout-link:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.es-logout-link .dashicons {
    margin-right: 8px;
}

.es-dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
}

.es-dashboard-header {
    margin-bottom: 40px;
}

.es-dashboard-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    color: #2c3e50;
}

.es-dashboard-subtitle {
    margin: 0;
    font-size: 1.1em;
    color: #7f8c8d;
}

/* Dashboard Widgets */
.es-dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.es-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.es-widget-full {
    grid-column: 1 / -1;
}

.es-widget-half {
    grid-column: span 1;
}

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

.es-widget-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.es-widget-header a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}

.es-widget-header a:hover {
    text-decoration: underline;
}

.es-widget-content {
    padding: 24px;
}

/* Wallet Widget */
.es-widget-wallet {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.es-widget-wallet .es-widget-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.es-widget-wallet .es-widget-header h3 {
    color: white;
}

.es-balance-amount {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
}

.es-widget-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.es-stat {
    display: flex;
    flex-direction: column;
}

.es-stat-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.es-stat-value {
    font-size: 1.2em;
    font-weight: 600;
}

/* Business Widget */
.es-business-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.es-business-info p {
    margin: 0 0 15px 0;
    color: #7f8c8d;
}

.es-business-stats {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Quick Actions */
.es-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.es-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.2s ease;
    text-align: center;
}

.es-quick-action:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.es-quick-action .dashicons {
    font-size: 28px;
    margin-bottom: 8px;
    color: #667eea;
}

.es-quick-action span:last-child {
    font-size: 0.9em;
    font-weight: 600;
}

/* Stats Grid */
.es-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.es-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.es-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.es-stat-icon .dashicons {
    font-size: 24px;
    color: white;
}

.es-stat-primary { background: #667eea; }
.es-stat-success { background: #2ecc71; }
.es-stat-warning { background: #f39c12; }
.es-stat-info { background: #3498db; }

.es-stat-info {
    flex: 1;
}

.es-stat-value {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 3px;
    color: #2c3e50;
}

.es-stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Leaderboard Mini */
.es-leaderboard-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.es-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.es-rank {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
    min-width: 35px;
}

.es-student-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.es-balance {
    font-weight: 600;
    color: #2ecc71;
}

/* Business List Mini */
.es-business-list-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.es-business-item-mini {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.es-business-item-mini strong {
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
}

.es-business-type {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Transactions Table */
.es-transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.es-transactions-table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.9em;
    border-bottom: 2px solid #e1e8ed;
}

.es-transactions-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e1e8ed;
}

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

.es-transactions-table tbody tr:hover {
    background: #f8f9fa;
}

.es-text-success {
    color: #2ecc71;
}

.es-text-danger {
    color: #e74c3c;
}

/* Badge */
.es-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.es-badge-purchase { background: #e3f2fd; color: #1976d2; }
.es-badge-sale { background: #e8f5e9; color: #388e3c; }
.es-badge-trade { background: #fff3e0; color: #f57c00; }
.es-badge-starting_balance { background: #f3e5f5; color: #7b1fa2; }

/* Empty State */
.es-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.es-empty-state p {
    margin: 0 0 20px 0;
}

/* Notice */
.es-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.es-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.es-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.es-notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading State */
.es-loading-state {
    text-align: center;
    padding: 60px 20px;
}

.es-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.es-loading-state p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Error State */
.es-error-state {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
}

.es-error-state p {
    font-size: 1.1em;
}

/* Businesses Grid */
.es-businesses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.es-business-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.es-business-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.es-business-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.es-business-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.es-business-card .es-business-type {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.es-business-card .es-business-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #e1e8ed;
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 1024px) {
    .es-dashboard-sidebar {
        width: 240px;
    }

    .es-dashboard-main {
        margin-left: 240px;
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .es-landing-content h1 {
        font-size: 2em;
    }

    .es-tagline {
        font-size: 1.1em;
    }

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

    .es-login-box {
        padding: 30px 20px;
    }

    .es-dashboard-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .es-dashboard-main {
        margin-left: 0;
        padding: 20px;
    }

    .es-dashboard-widgets {
        grid-template-columns: 1fr;
    }

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

    .es-quick-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .es-landing-content h1 {
        font-size: 1.8em;
    }

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

    .es-transactions-table {
        font-size: 0.9em;
    }

    .es-transactions-table thead th,
    .es-transactions-table tbody td {
        padding: 8px;
    }
}
