/**
 * CSS Administration - Mini Blog
 * Design simple et responsive pour mobile et desktop
 */

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

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

a {
    color: #4A90A4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout admin */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: block;
    padding: 12px 25px;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
    font-size: 15px;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.sidebar-menu .separator {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 15px 20px;
}

/* Contenu principal */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.content-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

.content-header p {
    color: #666;
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 25px;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-small {
    max-width: 400px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #4A90A4;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Quick action */
.quick-action {
    margin-bottom: 30px;
}

/* Article list */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.article-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.article-info h3 a {
    color: #333;
}

.article-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.article-date {
    color: #888;
    font-size: 13px;
}

.article-category {
    color: #4A90A4;
    font-size: 13px;
}

.article-actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-draft {
    background: #fff3e0;
    color: #e65100;
}

.badge-warning {
    background: #fff8e1;
    color: #f57f17;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: #4A90A4;
    color: white;
}

.btn-primary:hover {
    background: #3d7a8c;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

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

.btn-danger:hover {
    background: #d32f2f;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4A90A4;
}

.input-large {
    font-size: 20px;
    padding: 15px;
}

.input-medium {
    max-width: 300px;
}

textarea {
    resize: vertical;
    min-height: 200px;
}

.hint {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1;
    min-width: 200px;
}

/* Editor toolbar */
.editor-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.editor-toolbar button:hover {
    background: #e9ecef;
}

.editor-form textarea {
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
}

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

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

/* Category list */
.category-list {
    list-style: none;
    margin-top: 15px;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    color: #666;
    font-size: 14px;
    border: 1px solid #e0e0e0;
}

.filter-btn.active {
    background: #4A90A4;
    color: white;
    border-color: #4A90A4;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-info {
    color: #666;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin-bottom: 15px;
}

.view-all {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Login page - Design aux couleurs d'Israël */
.login-page {
    background: linear-gradient(180deg, #0038b8 0%, #0038b8 20%, #ffffff 20%, #ffffff 80%, #0038b8 80%, #0038b8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Étoile de David décorative en arrière-plan */
.login-page::before {
    content: "✡";
    position: absolute;
    font-size: 400px;
    color: rgba(0, 56, 184, 0.05);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* Bandes décoratives */
.login-page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(180deg,
            transparent 0%,
            transparent 22%,
            rgba(0, 56, 184, 0.1) 22%,
            rgba(0, 56, 184, 0.1) 28%,
            transparent 28%,
            transparent 72%,
            rgba(0, 56, 184, 0.1) 72%,
            rgba(0, 56, 184, 0.1) 78%,
            transparent 78%);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    background: white;
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 56, 184, 0.25);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 3px solid #0038b8;
}

/* Bandeau bleu en haut du formulaire */
.login-container::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 8px;
    background: linear-gradient(90deg, #0038b8, #4169e1, #0038b8);
    border-radius: 20px 20px 0 0;
}

.login-icon {
    font-size: 60px;
    margin-bottom: 10px;
    display: block;
}

/* Étoile de David dans l'icône */
.login-icon::before {
    content: "🇮🇱";
    font-size: 35px;
    display: block;
    margin-bottom: 5px;
}

.login-container h1 {
    font-size: 26px;
    margin-bottom: 5px;
    color: #0038b8;
    font-weight: 700;
}

.login-container .subtitle {
    color: #4169e1;
    margin-bottom: 35px;
    font-size: 15px;
    font-weight: 500;
}

.login-form {
    text-align: left;
}

.login-form .form-group label {
    color: #0038b8;
    font-weight: 600;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    border: 2px solid #d0d8e8;
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.3s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: #0038b8;
    box-shadow: 0 0 0 4px rgba(0, 56, 184, 0.15);
}

.login-form .btn-primary {
    background: linear-gradient(135deg, #0038b8 0%, #4169e1 100%);
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 56, 184, 0.3);
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 56, 184, 0.4);
    background: linear-gradient(135deg, #002d8f 0%, #0038b8 100%);
}

.back-link {
    display: block;
    margin-top: 30px;
    color: #0038b8;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: #4169e1;
}

/* Animation subtile */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.login-container h1 {
    background: linear-gradient(90deg, #0038b8, #4169e1, #0038b8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Image upload zone */
.image-upload-zone {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
    border-color: #4A90A4;
    background: #e8f4f8;
}

.image-upload-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.image-upload-zone p {
    color: #666;
    margin: 0;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: #4A90A4;
    width: 100%;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.existing-images {
    margin-top: 20px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.gallery-item:hover {
    border-color: #4A90A4;
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Section vidéo */
.video-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.video-option {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.video-option h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #333;
}

.video-option input[type="file"],
.video-option input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.video-option .btn {
    width: 100%;
}

@media (max-width: 768px) {
    .video-options {
        grid-template-columns: 1fr;
    }
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 5px;
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        padding: 70px 15px 30px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-header h1 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-actions {
        width: 100%;
    }

    .article-actions .btn {
        flex: 1;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .login-container {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}
