/* Styles généraux pour ProjectPilot */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* Page de connexion */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

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

.login-header h1 {
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
    font-size: 0.9rem;
}

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

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background-color: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #feb2b2;
}

/* Layout de l'application */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2d3748;
    color: white;
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1rem 1rem;
    border-bottom: 1px solid #4a5568;
}

.sidebar-header h2 {
    color: #e2e8f0;
    font-size: 1.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #4a5568;
    color: white;
}

.sidebar-footer {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    background: #f7fafc;
}

.main-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-header h1 {
    color: #2d3748;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.theme-toggle:hover {
    background: #f7fafc;
}

.dashboard-content {
    padding: 2rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #718096;
    font-size: 0.9rem;
}

.quick-actions h2 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

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

.project-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.project-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.project-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.project-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-en-cours { background: #c6f6d5; color: #22543d; }
.badge-en-pause { background: #fed7cc; color: #7c2d12; }
.badge-terminé { background: #dbeafe; color: #1e3a8a; }
.badge-archivé { background: #f3f4f6; color: #374151; }
.badge-haute { background: #fee2e2; color: #991b1b; }
.badge-moyenne { background: #fef3c7; color: #92400e; }
.badge-basse { background: #d1fae5; color: #065f46; }

.project-body {
    padding: 1rem;
}

.project-body p {
    margin: 0 0 1rem 0;
    color: #4a5568;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #718096;
}

.project-actions {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #2d3748;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-card i {
    font-size: 2rem;
    color: #667eea;
}

/* Icônes (utiliser Font Awesome ou similaires) */
.icon-dashboard:before { content: "📊"; }
.icon-projets:before { content: "📁"; }
.icon-cles:before { content: "🔑"; }
.icon-utilisateurs:before { content: "👥"; }
.icon-logs:before { content: "📋"; }
.icon-plus:before { content: "➕"; }
.icon-list:before { content: "📋"; }
.icon-key:before { content: "🔑"; }

/* Contenu */
.content {
    padding: 2rem;
}

.actions-bar {
    margin-bottom: 1rem;
}

.filters-bar {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.data-table tr:hover {
    background: #f7fafc;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-warning {
    background-color: #d69e2e;
    color: white;
}

.btn-warning:hover {
    background-color: #b7791f;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    color: #a0aec0;
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.close:hover {
    color: #2d3748;
    background-color: #e2e8f0;
}

.modal form {
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

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

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal .form-group select {
    cursor: pointer;
}

.project-details {
    padding: 2rem;
}

.detail-row {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-row strong {
    display: inline-block;
    min-width: 140px;
    color: #2d3748;
    font-weight: 600;
    flex-shrink: 0;
}

.detail-row span {
    color: #4a5568;
}

/* Clés SSH */
.keys-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.key-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.key-info {
    flex: 1;
}

.key-info h3 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.key-info p {
    margin: 0.5rem 0;
    color: #4a5568;
}

.public-key {
    display: block;
    background: #f7fafc;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
    word-break: break-all;
    border: 1px solid #e2e8f0;
    margin: 0.5rem 0;
}

.key-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.warning {
    color: #e53e3e;
    font-weight: 500;
}

/* Messages */
.message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.message.success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message.error {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .main-header {
        padding: 1rem;
    }

    .dashboard-content,
    .content {
        padding: 1rem;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}