/* Frontend Styles for Custom Investment Plugin */

/* Base Styles */
.cip-user-dashboard,
.cip-investment-plans,
.cip-auction-market,
.cip-wallet-funding {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dashboard Header */
.cip-dashboard-header,
.cip-plans-header,
.cip-market-header,
.cip-funding-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.cip-dashboard-header h2,
.cip-plans-header h2,
.cip-market-header h2,
.cip-funding-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 600;
}

.cip-user-info,
.cip-user-balance {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    margin-top: 10px;
    font-weight: 500;
}

/* Wallet Overview */
.cip-wallet-overview {
    margin-bottom: 30px;
}

.cip-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cip-balance-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    opacity: 0.9;
}

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

/* Summary Cards */
.cip-investment-summary {
    margin-bottom: 30px;
}

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

.cip-summary-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

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

.cip-summary-card h4 {
    color: #6c757d;
    font-size: 0.9em;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cip-summary-number {
    font-size: 2.2em;
    font-weight: 700;
    color: #2c3e50;
}

/* Investment Plans Grid */
.cip-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.cip-plan-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.cip-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.cip-plan-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.cip-plan-name {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    font-weight: 600;
}

.cip-plan-roi {
    font-size: 2.2em;
    font-weight: 700;
    opacity: 0.95;
}

.cip-plan-details {
    padding: 25px;
}

.cip-plan-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.cip-plan-detail:last-child {
    border-bottom: none;
}

.cip-detail-label {
    color: #6c757d;
    font-weight: 500;
}

.cip-detail-value {
    color: #2c3e50;
    font-weight: 600;
}

.cip-plan-actions {
    padding: 0 25px 25px 25px;
}

/* Auction Cards */
.cip-auctions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.cip-auction-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
}

.cip-auction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.cip-auction-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.cip-auction-plan {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.cip-auction-seller {
    opacity: 0.9;
    font-size: 0.9em;
}

.cip-auction-details {
    padding: 20px;
}

.cip-auction-amounts,
.cip-auction-pricing,
.cip-auction-meta {
    margin-bottom: 15px;
}

.cip-amount-item,
.cip-price-item,
.cip-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.cip-amount-item:last-child,
.cip-price-item:last-child,
.cip-meta-item:last-child {
    border-bottom: none;
}

.cip-current-bid {
    color: #28a745;
    font-weight: 700;
}

.cip-buy-now {
    color: #dc3545;
    font-weight: 700;
}

.cip-auction-timer {
    background: #f8f9fa;
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.cip-timer-label {
    color: #6c757d;
    font-size: 0.9em;
}

.cip-timer-value {
    color: #dc3545;
    font-weight: 700;
    margin-left: 10px;
}

/* Buttons */
.cip-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.cip-btn-primary {
    background: #007cba;
    color: white;
}

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

.cip-btn-secondary {
    background: #6c757d;
    color: white;
}

.cip-btn-secondary:hover {
    background: #545b62;
}

.cip-btn-success {
    background: #28a745;
    color: white;
}

.cip-btn-success:hover {
    background: #1e7e34;
}

.cip-btn-disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.cip-btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
}

.cip-btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

.cip-btn-full {
    width: 100%;
}

/* Tables */
.cip-investments-table,
.cip-auctions-table,
.cip-orders-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.cip-investments-table table,
.cip-auctions-table table,
.cip-orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.cip-investments-table th,
.cip-auctions-table th,
.cip-orders-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.cip-investments-table td,
.cip-auctions-table td,
.cip-orders-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.cip-investments-table tr:hover,
.cip-auctions-table tr:hover,
.cip-orders-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.cip-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.cip-status-matured {
    background: #fff3cd;
    color: #856404;
}

.cip-status-auctioned {
    background: #cce5ff;
    color: #004085;
}

.cip-status-sold {
    background: #d1ecf1;
    color: #0c5460;
}

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

.cip-status-approved {
    background: #d4edda;
    color: #155724;
}

.cip-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Modals */
.cip-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.cip-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.cip-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
}

.cip-close:hover {
    color: #000;
}

/* Forms */
.cip-form-group {
    margin-bottom: 20px;
}

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

.cip-form-group input,
.cip-form-group select,
.cip-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.cip-form-group input:focus,
.cip-form-group select:focus,
.cip-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cip-form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
}

.cip-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Investment Preview */
.cip-investment-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.cip-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.cip-preview-item:last-child {
    border-bottom: none;
}

.cip-preview-total {
    font-weight: 700;
    font-size: 1.1em;
    color: #28a745;
    border-top: 2px solid #28a745;
    padding-top: 12px;
    margin-top: 8px;
}

/* Funding Specific Styles */
.cip-funding-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.cip-funding-form-section,
.cip-bank-details-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.cip-bank-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    margin-bottom: 20px;
    white-space: pre-line;
    font-family: monospace;
}

.cip-transfer-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
}

.cip-transfer-note ul {
    margin: 10px 0 0 20px;
}

.cip-transfer-note li {
    margin-bottom: 8px;
    color: #856404;
}

.cip-fiat-amount {
    font-size: 1.5em;
    font-weight: 700;
    color: #28a745;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.cip-current-balance {
    text-align: center;
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cip-user-dashboard,
    .cip-investment-plans,
    .cip-auction-market,
    .cip-wallet-funding {
        padding: 15px;
    }
    
    .cip-summary-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .cip-plans-grid,
    .cip-auctions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cip-funding-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cip-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .cip-form-actions {
        flex-direction: column;
    }
    
    .cip-btn-full {
        width: 100%;
    }
    
    /* Make tables scrollable on mobile */
    .cip-investments-table,
    .cip-auctions-table,
    .cip-orders-table {
        overflow-x: auto;
    }
    
    .cip-investments-table table,
    .cip-auctions-table table,
    .cip-orders-table table {
        min-width: 600px;
    }
}

/* Loading States */
.cip-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.cip-text-center { text-align: center; }
.cip-text-right { text-align: right; }
.cip-text-success { color: #28a745; }
.cip-text-danger { color: #dc3545; }
.cip-text-warning { color: #ffc107; }
.cip-text-info { color: #17a2b8; }

.cip-mb-0 { margin-bottom: 0; }
.cip-mb-1 { margin-bottom: 10px; }
.cip-mb-2 { margin-bottom: 20px; }
.cip-mb-3 { margin-bottom: 30px; }

.cip-mt-0 { margin-top: 0; }
.cip-mt-1 { margin-top: 10px; }
.cip-mt-2 { margin-top: 20px; }
.cip-mt-3 { margin-top: 30px; }