/**
 * Entrepreneur Simulator - Public Styles
 * Main styles for student-facing pages
 */

/* Reset and Base Styles */
.es-my-business-container,
.es-wallet-page,
.es-transactions-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Notices */
.es-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.es-notice-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.es-notice-error {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.es-notice-success {
    background-color: #d4edda;
    border-left: 4px solid: #28a745;
    color: #155724;
}

.es-notice-info {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* Wallet Summary */
.es-wallet-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.es-wallet-summary h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
}

.es-wallet-balance {
    display: flex;
    align-items: baseline;
    margin-bottom: 25px;
}

.es-balance-label {
    font-size: 16px;
    opacity: 0.9;
    margin-right: 15px;
}

.es-balance-amount {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
}

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

.es-wallet-stats .es-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.es-stat-label {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.es-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

/* Business Creation Section */
.es-create-business-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.es-create-business-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 32px;
    color: #2c3e50;
}

.es-create-business-section > p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 30px;
}

/* Forms */
.es-form {
    margin-top: 20px;
}

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

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

.es-form-group input[type="text"],
.es-form-group input[type="email"],
.es-form-group input[type="url"],
.es-form-group input[type="number"],
.es-form-group select,
.es-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.es-form-group input:focus,
.es-form-group select:focus,
.es-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.es-form-group input[type="color"] {
    width: 80px;
    height: 40px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
}

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

/* Buttons */
.es-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    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 10px 25px rgba(102, 126, 234, 0.4);
}

.es-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

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

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

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

.es-btn-large {
    padding: 15px 32px;
    font-size: 16px;
}

.es-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.es-btn:disabled,
.es-btn-disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Business Dashboard */
.es-business-dashboard {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.es-business-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.es-business-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.es-business-logo-small {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.es-business-title h2 {
    margin: 0;
    color: #2c3e50;
}

.es-business-type {
    color: #7f8c8d;
    font-size: 14px;
    margin: 5px 0 0 0;
}

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

.es-stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

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

.es-stat-icon {
    font-size: 36px;
}

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

.es-stat-info .es-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.es-stat-info .es-stat-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.es-products-section,
.es-transactions-section {
    margin-top: 40px;
}

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

.es-section-header h3 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

/* Tables */
.es-products-table,
.es-transactions-table {
    overflow-x: auto;
}

.es-products-table table,
.es-transactions-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.es-products-table th,
.es-transactions-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e8ed;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.es-products-table td,
.es-transactions-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    color: #34495e;
}

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

.es-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.es-product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.es-status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.es-status-active {
    background: #d4edda;
    color: #155724;
}

.es-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

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

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

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

/* Empty States */
.es-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.es-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Modal */
.es-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.es-modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.es-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: 300;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.3s;
}

.es-modal-close:hover {
    color: #2c3e50;
}

.es-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
}

/* Wallet Page */
.es-wallet-balance-card {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 50px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.3);
}

.es-wallet-balance-card h3 {
    margin-top: 0;
    font-size: 18px;
    opacity: 0.9;
}

.es-balance-amount-large {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 0;
}

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

.es-wallet-stats-grid .es-stat-card {
    flex-direction: column;
    align-items: flex-start;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Transaction amounts */
.es-amount-positive {
    color: #27ae60;
    font-weight: 600;
}

.es-amount-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* Loading Spinner */
.es-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Custom Page Wrapper */
.es-custom-page-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.es-custom-page-wrapper .entry-header {
    margin-bottom: 30px;
}

.es-custom-page-wrapper .entry-title {
    font-size: 36px;
    margin-bottom: 10px;
}

.es-custom-page-wrapper .entry-content {
    line-height: 1.6;
}

/* Trading Page Styles */
.es-trading-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.es-trading-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.es-trading-balance,
.es-portfolio-value {
    margin-bottom: 25px;
}

.es-trading-balance h3,
.es-portfolio-value h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #7f8c8d;
}

.es-trading-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.es-trading-tab {
    padding: 12px 20px;
    background: #ecf0f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.es-trading-tab:hover {
    background: #d5dbdd;
}

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

.es-trading-tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.es-trading-tab-content.active {
    display: block;
}

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

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

.es-trading-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e1e8ed;
}

.es-trading-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

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

.es-price-positive {
    color: #27ae60;
}

.es-price-negative {
    color: #e74c3c;
}

.es-trading-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

.es-portfolio-stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
}

.es-portfolio-stat-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.es-portfolio-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.es-positive {
    color: #27ae60;
}

.es-negative {
    color: #e74c3c;
}

/* Leaderboard Page */
.es-leaderboard-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.es-leaderboard-page h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

.es-leaderboard-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

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

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

.es-leaderboard-table thead th {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e8ed;
}

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

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

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

.es-rank-cell {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.es-rank-medal {
    font-size: 24px;
}

.es-rank-number {
    font-size: 18px;
}

.es-rank-gold .es-rank-number {
    color: #FFD700;
}

.es-rank-silver .es-rank-number {
    color: #C0C0C0;
}

.es-rank-bronze .es-rank-number {
    color: #CD7F32;
}

.es-current-user {
    background: #e3f2fd !important;
    border-left: 4px solid #2196F3;
}

.es-current-user:hover {
    background: #bbdefb !important;
}

.es-balance-cell {
    font-weight: 700;
    color: #2ecc71;
    font-size: 16px;
}

.es-badge-you {
    background: #2196F3;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-left: 8px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .es-business-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

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

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

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

    .es-wallet-balance {
        flex-direction: column;
        align-items: flex-start;
    }

    .es-balance-amount {
        font-size: 32px;
    }

    .es-balance-amount-large {
        font-size: 40px;
    }

    .es-products-table,
    .es-transactions-table,
    .es-leaderboard-table table {
        font-size: 13px;
    }

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

    .es-rank-medal {
        font-size: 18px;
    }

    .es-rank-number {
        font-size: 14px;
    }
}
