* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #202124;
    background: #fff;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #dfe1e5;
    background: #fff;
}

.brand {
    font-size: 1.4rem;
    color: #4285f4;
    text-decoration: none;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
}

.nav-links a {
    color: #5f6368;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #4285f4;
    text-decoration: underline;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    padding: 2rem;
}

.tagline {
    color: #5f6368;
    margin-bottom: 2rem;
}

.logo {
    font-size: 3.5rem;
    color: #4285f4;
    margin-bottom: 0.5rem;
}

.logo-small {
    font-size: 1.5rem;
    color: #4285f4;
    text-decoration: none;
    font-weight: 700;
    margin-right: 1rem;
    white-space: nowrap;
}

.search-form, .search-form-inline {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 640px;
    gap: 0.5rem;
}

.search-box {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
}

.search-box:focus {
    border-color: #4285f4;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}

.search-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 24px;
    background: #4285f4;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.search-button:hover {
    background: #357ae8;
}

.hint {
    margin-top: 1rem;
    color: #5f6368;
}

.hint a {
    color: #1a0dab;
    text-decoration: none;
}

.results-header {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #dfe1e5;
    gap: 1rem;
}

.stats {
    padding: 1rem 2rem;
    color: #70757a;
    font-size: 0.9rem;
}

.results {
    padding: 0 2rem 2rem;
    max-width: 800px;
}

.result {
    margin-bottom: 1.5rem;
}

.result-title {
    display: block;
    color: #1a0dab;
    font-size: 1.1rem;
    text-decoration: none;
}

.result-title:hover {
    text-decoration: underline;
}

.result-score {
    color: #006621;
    font-size: 0.85rem;
}

.result-snippet {
    color: #4d5156;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.25rem 0 0;
}

.finance-card {
    max-width: 800px;
    margin: 1rem 2rem;
    padding: 1.25rem;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.finance-name {
    margin: 0;
    font-size: 1.25rem;
    color: #202124;
}

.finance-symbol {
    color: #5f6368;
    font-weight: 500;
}

.finance-exchange {
    color: #5f6368;
    font-size: 0.85rem;
}

.finance-price-wrap {
    text-align: right;
}

.finance-price {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #202124;
}

.finance-change {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
}

.finance-change.up {
    color: #0f9d58;
}

.finance-change.down {
    color: #c5221f;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #4d5156;
}

.finance-table tr {
    border-bottom: 1px solid #f1f3f4;
}

.finance-table td {
    padding: 0.75rem 0.5rem;
}

.finance-table td:first-child {
    width: 40%;
    color: #5f6368;
    font-weight: 500;
}

.finance-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #202124;
}

@media (max-width: 480px) {
    .finance-table td:first-child {
        width: 55%;
    }
}

.no-results {
    padding: 1rem 2rem;
    color: #5f6368;
}

.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    padding: 2rem;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.auth-card h2 {
    margin-top: 0;
    color: #202124;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form label {
    color: #5f6368;
    font-size: 0.9rem;
}

.auth-form input {
    padding: 0.75rem 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    border-color: #4285f4;
    outline: none;
}

.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 0.65rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: #202124;
}

.auth-form input[type="file"] {
    padding: 0.5rem 0;
    border: none;
}

.auth-form input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.auth-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

select.search-box {
    flex: 0 0 auto;
    min-width: 150px;
    background: #fff;
}

.flash-messages {
    max-width: 560px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.flash {
    background: #fce8e8;
    color: #c5221f;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    border-top: 1px solid #dfe1e5;
    color: #5f6368;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Mice OS Apps */
.apps-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.apps-page h1 {
    margin-bottom: 1.5rem;
    color: #202124;
}

.apps-page h2 {
    margin-bottom: 1rem;
    color: #202124;
}

.upload-section {
    margin-bottom: 2rem;
    max-width: 100%;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.app-card {
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.app-name {
    margin: 0;
    font-size: 1.15rem;
    color: #202124;
}

.app-version {
    color: #5f6368;
    font-size: 0.85rem;
    font-weight: 500;
}

.app-description {
    color: #4d5156;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.app-meta span {
    font-size: 0.8rem;
    color: #5f6368;
    background: #f1f3f4;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
}

.app-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.download-button {
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.delete-button {
    padding: 0.65rem 1.25rem;
    border: 1px solid #c5221f;
    border-radius: 8px;
    background: #fff;
    color: #c5221f;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.delete-button:hover {
    background: #c5221f;
    color: #fff;
}

.apps-filters {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.apps-filters .search-box {
    flex: 1 1 160px;
    min-width: 140px;
}

.app-name-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.app-name-link:hover .app-name {
    color: #4285f4;
}

.details-link {
    color: #4285f4;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
}

.details-link:hover {
    text-decoration: underline;
}

.category-badge {
    display: inline-block;
    background: #e8eaed;
    color: #3c4043;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.category-badge[data-category="bureautique"] { background: #e8f0fe; color: #1967d2; }
.category-badge[data-category="jeu"],
.category-badge[data-category="jeux"] { background: #fce8e6; color: #c5221f; }
.category-badge[data-category="utilitaire"],
.category-badge[data-category="utilitaires"] { background: #e6f4ea; color: #188038; }
.category-badge[data-category="développement"] { background: #fef7e0; color: #b06000; }
.category-badge[data-category="multimédia"] { background: #f3e8fd; color: #7b1fa2; }

.app-detail-card {
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    max-width: 720px;
    margin: 0 auto;
}

.app-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.app-detail-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.8rem;
}

.app-detail-description h2,
.app-detail-info h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: #202124;
}

.app-detail-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.app-detail-table th,
.app-detail-table td {
    padding: 0.75rem 0;
    text-align: left;
    border-bottom: 1px solid #e8eaed;
}

.app-detail-table th {
    width: 35%;
    color: #5f6368;
    font-weight: 500;
}

.app-detail-table td {
    color: #202124;
}

.app-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.download-button-large {
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
}
