/* 
  Modern SaaS Web Portal CSS 
  Clean, elegant, professional layout
*/

:root {
    --brand-navy: #002d4a; 
    --brand-yellow: #fdd64b;
    --navy-light: #00446b;
    
    --bg-color: #f5f5f5;        /* Fond gris un peu plus clair */
    --surface: #ffffff;         /* Card surface */
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.site-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

/* User Profile (Admin Actions) */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--brand-navy);
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
}

.icon-btn:hover {
    background-color: #f1f5f9;
}

.hidden {
    display: none !important;
}

/* Hero Section */
.hero-section {
    padding: 60px 0 40px;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    width: 100%;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

/* Modern Card */
.modern-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
}

.modern-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* Admin Card Actions (Edit/Delete) */
.card-admin-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

body.admin-mode .modern-card:hover .card-admin-actions {
    opacity: 1;
}

.admin-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.2s, color 0.2s;
}

.admin-action-btn:hover {
    background: #fff;
    color: var(--brand-navy);
}

.admin-action-btn.delete-btn:hover {
    color: #ef4444;
}

/* Card Image (Removed zoom on hover) */
.card-image-wrap {
    width: 100%;
    aspect-ratio: 4/3;   
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;     
    object-position: center;
}

/* Overlay */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.02));
    pointer-events: none;
}

/* Card Content */
.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-text {
    flex-grow: 1;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Button */
.card-action {
    display: flex;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--brand-navy);
    color: #ffffff !important; 
    border: 1px solid var(--brand-navy);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    background-color: var(--navy-light);
    border-color: var(--navy-light);
    color: #ffffff !important;
}

.icon-arrow {
    transition: transform var(--transition);
}

.btn-primary:hover .icon-arrow {
    transform: translateX(4px);
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 32px 24px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--brand-navy);
    font-weight: 600;
    border-top: 1px solid var(--border-color);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover {
    color: #333;
}

.modal-title {
    font-size: 1.4rem;
    color: var(--brand-navy);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--brand-navy);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-navy);
}

.error-text {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}
