:root {
    --primary-color: #0a192f;
    --secondary-color: #64ffda;
    --accent-color: #ff4d4d;
    --success-color: #00ff9d;
    --background-color: #0a192f;
    --card-bg: rgba(17, 34, 64, 0.7);
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
}

/* Styles de base */
body {
    background: linear-gradient(-45deg, #0a192f, #112240, #1a365d, #2d3748);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Conteneurs et sections */
.container {
    padding: 0.75rem;
}

.header {
    text-align: center;
    margin-bottom: 1rem;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.4rem;
}

.calculator-section, .card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.calculator-section h2, .card-header h5 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Sections spéciales */
.cash-balance-section {
    background: rgba(100, 255, 218, 0.05);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

/* Tableaux */
.table {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0;
}

.table th {
    background: rgba(100, 255, 218, 0.1);
    color: var(--secondary-color);
    border-bottom: 2px solid rgba(100, 255, 218, 0.2);
    padding: 0.5rem;
    font-weight: 500;
}

.table td {
    padding: 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

/* Suppression des effets de survol par défaut */
.table tr:hover,
.table tr:hover td,
.table tr:hover td * {
    background: none;
    color: var(--text-primary);
}

/* Boutons */
.btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 0.3rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: #4cd8b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(100, 255, 218, 0.2);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: var(--primary-color);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 157, 0.2);
}

.btn-warning {
    background: var(--accent-color);
    color: var(--text-primary);
    border: none;
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 77, 77, 0.2);
}

.btn-outline-warning {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-warning:hover {
    background: var(--accent-color);
    color: var(--text-primary);
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: var(--text-primary);
}

/* Couleurs de texte */
.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--accent-color) !important;
}

/* Modales */
.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 20px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    padding: 0.75rem;
}

.modal-header .modal-title {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.modal-body {
    padding: 0.75rem;
}

.modal-footer {
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    padding: 0.75rem;
}

/* Formulaires */
.form-control {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-primary);
    padding: 0.4rem 0.6rem;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--secondary-color);
    color: var(--text-primary);
    box-shadow: none;
}

.form-label {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.input-group-text {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-secondary);
}

/* Éléments spécifiques */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.current-price-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.current-price-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.current-price-value {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 500;
}

.price-currency {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-left: 0.25rem;
}

/* Animations des boutons */
.btn-outline-warning,
.btn-outline-success {
    position: relative;
    overflow: hidden;
}

.btn-outline-warning:after,
.btn-outline-success:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-outline-warning:hover:after,
.btn-outline-success:hover:after {
    width: 200%;
    height: 200%;
}

/* Alertes et notifications */
.alert {
    background: var(--card-bg);
    border: 1px solid rgba(100, 255, 218, 0.1);
    color: var(--text-primary);
    border-radius: 10px;
    margin-bottom: 0.4rem;
    padding: 0.5rem 0.6rem;
}

.alert-success {
    border-color: var(--success-color);
}

.alert-danger {
    border-color: var(--accent-color);
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.navbar-brand {
    color: var(--secondary-color) !important;
}

.nav-link {
    color: var(--text-primary) !important;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Graphiques */
canvas {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1199.98px) {
    .container {
        padding: 0.75rem;
    }
}

@media (max-width: 991.98px) {
    .container {
        padding: 0.6rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .calculator-section, .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.875rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.3rem;
    }
}

@media (max-width: 767.98px) {
    .container {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .calculator-section, .card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }
    
    .calculator-section h2, .card-header h5 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        margin: 0.25rem 0;
        width: 100%;
        display: block;
    }
    
    .btn-group .btn {
        width: auto;
        margin: 0.125rem;
    }
    
    .form-control {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .table th,
    .table td {
        padding: 0.3rem 0.2rem;
        min-width: 80px;
    }
    
    .current-price-value {
        font-size: 1.3rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        border-radius: 15px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .alert {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding: 0.4rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-section, .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .calculator-section h2, .card-header h5 {
        font-size: 1.4rem;
    }
    
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
    
    .form-control {
        padding: 0.8rem 1rem;
        font-size: 1.1rem;
    }
    
    .form-label {
        font-size: 1.1rem;
    }
    
    .table {
        font-size: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.4rem;
        min-width: 90px;
    }
    
    .current-price-value {
        font-size: 1.6rem;
    }
    
    .modal-content {
        margin: 0.25rem;
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .alert {
        padding: 1rem;
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group-text {
        border-radius: 0.375rem 0.375rem 0 0;
        border-bottom: 0;
        font-size: 1.1rem;
        padding: 0.8rem 1rem;
    }
    
    .input-group .form-control {
        border-radius: 0 0 0.375rem 0.375rem;
    }
}

/* Améliorations pour les très petits écrans */
@media (max-width: 375px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .calculator-section, .card {
        padding: 0.8rem;
    }
    
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
    
    .form-control {
        padding: 0.7rem 0.8rem;
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .current-price-value {
        font-size: 1.4rem;
    }
} 

/* ============================================ */
/* TOGGLE SWITCH POUR FRAIS BANCAIRES */
/* ============================================ */

.toggle-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-color);
    transition: .4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: #8892b0;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-label {
    color: var(--text-secondary);
    background-color: rgba(100, 255, 218, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.toggle-label.active {
    color: var(--secondary-color);
    background-color: rgba(100, 255, 218, 0.2);
    font-weight: 600;
}

.fees-section {
    background: rgba(100, 255, 218, 0.05);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.fees-section .form-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.fees-section .form-control {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-primary);
}

.fees-section .input-group-text {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-secondary);
}

/* Responsive pour le toggle */
@media (max-width: 767.98px) {
    .toggle-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .toggle-switch {
        width: 50px;
        height: 25px;
    }
    
    .toggle-slider:before {
        height: 20px;
        width: 20px;
        left: 2.5px;
        bottom: 2.5px;
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(25px);
    }
    
    .toggle-label {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Titres principaux — alignés sur l’accueil « Mes Portefeuilles » (Inter, même échelle) */
h1.page-main-title {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.65rem, 1.15rem + 1.85vw, 2.55rem);
    line-height: 1.22;
    letter-spacing: -0.025em;
    color: var(--text-primary, #e6f1ff);
    margin-bottom: 0.5rem;
}

.portfolios-section h1.page-main-title {
    text-align: center;
    margin-bottom: 2rem;
}

p.page-main-lead {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    font-weight: 400;
    color: var(--text-secondary, #8892b0);
    max-width: 42rem;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    h1.page-main-title {
        font-size: 1.8rem;
    }
    .portfolios-section h1.page-main-title {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    h1.page-main-title {
        font-size: 1.6rem;
    }
    .portfolios-section h1.page-main-title {
        margin-bottom: 0.9rem;
    }
}