/**
 * Investment Viewer Plugin - Frontend CSS
 * Styles globaux pour tous les shortcodes
 */

/* Variables CSS */
:root {
    --iv-primary: #007cba;
    --iv-primary-hover: #005a87;
    --iv-success: #28a745;
    --iv-warning: #ffc107;
    --iv-danger: #dc3545;
    --iv-info: #17a2b8;
    --iv-light: #f8f9fa;
    --iv-dark: #343a40;
    --iv-border: #e9ecef;
    --iv-border-light: #f1f3f4;
    --iv-text: #2c3e50;
    --iv-text-muted: #6c757d;
    --iv-radius: 8px;
    --iv-radius-large: 12px;
    --iv-shadow: 0 2px 10px rgba(0,0,0,0.05);
    --iv-shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
    --iv-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset et base */
.investment-container,
.investment-container * {
    box-sizing: border-box;
}

.investment-container {
    font-family: var(--iv-font-family);
    color: var(--iv-text);
    line-height: 1.6;
}

/* Utilitaires globaux */
.investment-notice {
    padding: 15px 20px;
    border-radius: var(--iv-radius);
    margin: 20px 0;
    border-left: 4px solid;
    background: white;
    box-shadow: var(--iv-shadow);
}

.investment-notice.notice-warning {
    border-left-color: var(--iv-warning);
    background: #fff3cd;
    color: #856404;
}

.investment-notice.notice-error {
    border-left-color: var(--iv-danger);
    background: #f8d7da;
    color: #721c24;
}

.investment-notice.notice-success {
    border-left-color: var(--iv-success);
    background: #d4edda;
    color: #155724;
}

.investment-notice.notice-info {
    border-left-color: var(--iv-info);
    background: #cce7ff;
    color: #004085;
}

/* Boutons globaux */
.investment-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--iv-radius);
    text-decoration: none !important;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    line-height: 1.4;
}

.investment-btn:focus {
    outline: 2px solid var(--iv-primary);
    outline-offset: 2px;
}

.investment-btn.btn-primary {
    background-color: var(--iv-primary);
    color: white !important;
}

.investment-btn.btn-primary:hover {
    background-color: var(--iv-primary-hover);
    color: white !important;
    transform: translateY(-1px);
}

.investment-btn.btn-secondary {
    background-color: var(--iv-text-muted);
    color: white !important;
}

.investment-btn.btn-secondary:hover {
    background-color: #545b62;
    color: white !important;
    transform: translateY(-1px);
}

.investment-btn.btn-success {
    background-color: var(--iv-success);
    color: white !important;
}

.investment-btn.btn-success:hover {
    background-color: #218838;
    color: white !important;
}

.investment-btn.btn-outline {
    background-color: transparent;
    border: 2px solid var(--iv-primary);
    color: var(--iv-primary) !important;
}

.investment-btn.btn-outline:hover {
    background-color: var(--iv-primary);
    color: white !important;
}

/* Cards globales */
.investment-card {
    background: white;
    border: 1px solid var(--iv-border);
    border-radius: var(--iv-radius-large);
    box-shadow: var(--iv-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.investment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--iv-shadow-hover);
}

.investment-card-header {
    padding: 20px;
    background: var(--iv-light);
    border-bottom: 1px solid var(--iv-border);
}

.investment-card-body {
    padding: 20px;
}

.investment-card-footer {
    padding: 15px 20px;
    background: var(--iv-light);
    border-top: 1px solid var(--iv-border);
}

/* Grilles responsive */
.investment-grid {
    display: grid;
    gap: 20px;
}

.investment-grid.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.investment-grid.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.investment-grid.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Badges et statuts */
.investment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.investment-badge.status-completed {
    background: #cce7ff;
    color: #004085;
}

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

.investment-badge.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Indicateurs de chargement */
.investment-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--iv-text-muted);
}

.investment-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--iv-border);
    border-top: 2px solid var(--iv-primary);
    border-radius: 50%;
    animation: iv-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Barres de progression */
.investment-progress {
    width: 100%;
    height: 8px;
    background: var(--iv-border);
    border-radius: 4px;
    overflow: hidden;
}

.investment-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--iv-primary) 0%, var(--iv-primary-hover) 100%);
    transition: width 0.8s ease;
}

.investment-progress.success .investment-progress-bar {
    background: linear-gradient(90deg, var(--iv-success) 0%, #218838 100%);
}

.investment-progress.warning .investment-progress-bar {
    background: linear-gradient(90deg, var(--iv-warning) 0%, #e0a800 100%);
}

/* Tooltips */
.investment-tooltip {
    position: relative;
    cursor: help;
}

.investment-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--iv-dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--iv-radius);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.investment-tooltip::after {
    content: "";
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--iv-dark);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.investment-tooltip:hover::before,
.investment-tooltip:hover::after {
    opacity: 1;
}

/* Tables responsive */
.investment-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: var(--iv-radius);
    overflow: hidden;
    box-shadow: var(--iv-shadow);
}

.investment-table th,
.investment-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--iv-border-light);
}

.investment-table th {
    background: var(--iv-light);
    font-weight: 600;
    color: var(--iv-text);
    font-size: 14px;
}

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

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

/* Wrapper responsive pour tables */
.investment-table-wrapper {
    overflow-x: auto;
    border-radius: var(--iv-radius);
    border: 1px solid var(--iv-border);
}

/* Animations */
@keyframes iv-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes iv-slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.investment-animate-fade {
    animation: iv-fadeIn 0.5s ease forwards;
}

.investment-animate-slide {
    animation: iv-slideIn 0.3s ease forwards;
}

/* Responsive global */
@media (max-width: 768px) {
    .investment-grid.grid-2,
    .investment-grid.grid-3,
    .investment-grid.grid-4 {
        grid-template-columns: 1fr;
    }
    
    .investment-btn {
        width: 100%;
        text-align: center;
    }
    
    .investment-card-header,
    .investment-card-body,
    .investment-card-footer {
        padding: 15px;
    }
    
    .investment-table {
        font-size: 14px;
    }
    
    .investment-table th,
    .investment-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .investment-table {
        font-size: 12px;
    }
    
    .investment-table th,
    .investment-table td {
        padding: 6px 8px;
    }
    
    .investment-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Focus et accessibilité */
.investment-container *:focus {
    outline: 2px solid var(--iv-primary);
    outline-offset: 2px;
}

.investment-container button:focus,
.investment-container a:focus {
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.25);
}

/* Mode sombre (si supporté par le thème) */
@media (prefers-color-scheme: dark) {
    .investment-container {
        --iv-text: #e9ecef;
        --iv-text-muted: #adb5bd;
        --iv-border: #495057;
        --iv-border-light: #343a40;
        --iv-light: #343a40;
    }
    
    .investment-card {
        background: #212529;
        border-color: var(--iv-border);
    }
    
    .investment-table {
        background: #212529;
    }
    
    .investment-table th {
        background: var(--iv-light);
    }
}

/* Masquer le contenu pendant le chargement */
.investment-container[data-loading="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Styles pour l'impression */
@media print {
    .investment-container {
        color: black !important;
        background: white !important;
    }
    
    .investment-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
    
    .investment-btn {
        display: none !important;
    }
    
    .investment-tooltip::before,
    .investment-tooltip::after {
        display: none !important;
    }
} 