/* Variables CSS pour les thèmes */
:root {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #fefefe;
    --text-secondary: #d1d5db;
    --accent-gold: #FFD700;
    --red-action: #EF4444;
    --green-curve: #10B981;
    --border-color: #374151;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.light {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease-in-out;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header */
.header {
    padding: 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.logo-section {
    flex: 1;
}

.logo {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.home-link:hover {
    color: var(--accent-gold);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Tool Cards */
.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), #fbbf24);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-gold);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tool-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.feature {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-button {
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    color: #000;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

/* Footer */
.footer {
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--bg-secondary);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.8rem !important;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }

    .resources-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        max-width: none;
        width: 100%;
    }

    .header-actions {
        justify-content: center;
        width: 100%;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
        max-width: none;
    }

    .main-content {
        padding: 2rem 1rem;
        width: 100%;
        max-width: none;
    }

    .tool-card {
        padding: 1.5rem;
        width: 100%;
        max-width: none;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
    }

    .resources-section {
        padding: 3rem 1rem;
        width: 100%;
    }

    .tool-features {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .feature {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .logo {
        font-size: clamp(1.3rem, 3.5vw, 2rem);
    }

    .subtitle {
        font-size: clamp(0.85rem, 1.8vw, 1rem);
    }

    .tools-grid {
        gap: 1.25rem;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .tool-card, .resource-card {
        padding: 1.25rem;
    }

    .tool-description, .resource-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .header {
        padding: 1rem 0.75rem;
    }

    .main-content {
        padding: 1.25rem 0.75rem;
    }

    .tool-card, .resource-card {
        padding: 1rem;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .tool-icon, .resource-icon {
        font-size: 2.2rem;
        margin-bottom: 0.75rem;
    }

    .resource-icon-img {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .tool-title, .resource-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }

    .tool-description, .resource-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

    .tool-features {
        margin-bottom: 1.5rem;
        gap: 0.3rem;
        justify-content: center;
    }

    .feature {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .tool-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }

    .resources-section {
        padding: 2rem 0.75rem;
    }

    .resources-title {
        font-size: clamp(1.3rem, 3vw, 1.6rem);
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .home-link {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .logo-section {
        text-align: center;
        width: 100%;
    }

    .header-actions {
        flex-shrink: 0;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 1rem 0.75rem;
    }

    .main-content {
        padding: 1.25rem 0.75rem;
    }

    .tool-card, .resource-card {
        padding: 0.875rem;
    }

    .logo {
        font-size: clamp(1.2rem, 3vw, 1.8rem);
    }

    .subtitle {
        font-size: clamp(0.8rem, 1.6vw, 0.95rem);
    }

    .resources-section {
        padding: 2rem 0.75rem;
    }

    .footer {
        padding: 1.5rem 0.75rem;
    }
}

/* Welcome Section */
.welcome-section {
    background: var(--bg-secondary);
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.welcome-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.welcome-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.welcome-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.welcome-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bull-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.bull-image:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .welcome-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .welcome-section {
        padding: 2rem 1rem;
    }

    .bull-image {
        max-height: 150px;
    }

    .welcome-title {
        font-size: clamp(1.3rem, 2.8vw, 1.7rem);
    }

    .welcome-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 1.5rem 1rem;
    }

    .welcome-content {
        gap: 1.5rem;
    }

    .welcome-title {
        font-size: clamp(1.2rem, 2.5vw, 1.5rem);
        margin-bottom: 0.75rem;
    }

    .welcome-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .bull-image {
        max-height: 120px;
    }
}

@media (max-width: 360px) {
    .welcome-section {
        padding: 1.25rem 0.75rem;
    }

    .bull-image {
        max-height: 100px;
    }
}

/* Resources Section */
.resources-section {
    background: var(--bg-secondary);
    padding: 4rem 1rem;
    border-top: 1px solid var(--border-color);
}

.resources-container {
    max-width: 1200px;
    margin: 0 auto;
}

.resources-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3rem;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: block;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), #fbbf24);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-gold);
}

.resource-card:hover::before {
    transform: scaleX(1);
}

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.resource-icon-img {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto 1rem auto;
}

.resource-icon-img:hover {
    transform: scale(1.1);
}

.resource-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.resource-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

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

.tool-card, .resource-card {
    animation: fadeIn 0.6s ease forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }

.resource-card:nth-child(1) { animation-delay: 0.4s; }
.resource-card:nth-child(2) { animation-delay: 0.5s; }
.resource-card:nth-child(3) { animation-delay: 0.6s; }
.resource-card:nth-child(4) { animation-delay: 0.7s; }

/* Navigation commune pour les modules */
.back-nav {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
}

.back-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
}

.back-button:hover {
    transform: scale(1.1);
    border-color: var(--accent-gold);
    background: var(--accent-gold);
    color: #000;
}

/* Styles pour les formulaires des calculatrices */
.calculator-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-top: 5rem;
}

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

.calculator-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.calculator-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section, .result-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.calculate-button {
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    color: #000;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-label {
    font-weight: 600;
    color: var(--text-primary);
}

.result-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.chart-container {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .calculator-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calculator-container {
        padding: 1.5rem 1rem;
        padding-top: 4rem;
    }

    .input-section, .result-section {
        padding: 1.5rem;
    }

    .calculator-title {
        font-size: clamp(1.5rem, 3.5vw, 2rem);
    }

    .calculator-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .calculator-container {
        padding: 1.25rem 0.75rem;
        padding-top: 3.5rem;
    }

    .input-section, .result-section, .chart-container {
        padding: 1.25rem;
    }

    .calculator-title {
        font-size: clamp(1.3rem, 3vw, 1.8rem);
    }

    .calculator-subtitle {
        font-size: 0.95rem;
    }

    .form-input, .form-select {
        padding: 0.625rem;
        font-size: 0.95rem;
    }

    .calculate-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .result-item {
        padding: 0.75rem 0;
    }

    .result-label {
        font-size: 0.9rem;
    }

    .result-value {
        font-size: 1.1rem;
    }
}
