/* Variables */
:root {
    --primary-color: #007AFF;
    --primary-hover: #0051D5;
    --success-color: #34C759;
    --error-color: #FF3B30;
    --warning-color: #FF9500;
    --background: #F5F5F7;
    --surface: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border: #D2D2D7;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

/* Container */
.ve-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
}

/* Loading */
.ve-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ve-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Welcome Card */
.ve-no-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.ve-welcome-card {
    text-align: center;
    max-width: 500px;
    padding: 60px 40px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px var(--shadow);
    animation: fadeInUp 0.6s ease;
}

.ve-icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--primary-color), #00C7BE);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease infinite;
}

.ve-icon-large svg {
    width: 40px;
    height: 40px;
    stroke: white;
    stroke-width: 2;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ve-welcome-card h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-primary);
}

.ve-welcome-card p {
    font-size: 17px;
    color: var(--text-secondary);
    margin: 0 0 40px;
    line-height: 1.5;
}

/* Buttons */
.ve-btn-primary,
.ve-btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ve-btn-primary {
    background: var(--primary-color);
    color: white;
}

.ve-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

.ve-btn-secondary {
    background: var(--background);
    color: var(--text-primary);
}

.ve-btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.ve-btn-large {
    padding: 16px 40px;
    font-size: 17px;
}

.ve-btn-primary svg,
.ve-btn-secondary svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Dashboard */
.ve-dashboard {
    animation: fadeIn 0.4s ease;
}

.ve-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.ve-dashboard-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
}

/* Tabs */
.ve-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
}

.ve-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.ve-tab:hover {
    background: var(--background);
}

.ve-tab.active {
    background: var(--primary-color);
    color: white;
}

.ve-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ve-tab-content.active {
    display: block;
}

/* Pages Grid */
.ve-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.ve-page-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 12px var(--shadow);
    transition: var(--transition);
    position: relative;
}

.ve-page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-lg);
}

.ve-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ve-page-header img,
.ve-page-logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.ve-page-logo-placeholder {
    background: linear-gradient(135deg, var(--primary-color), #00C7BE);
}

.ve-page-info {
    flex: 1;
}

.ve-page-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.ve-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ve-status-published {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.ve-status-pending {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning-color);
}

.ve-page-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ve-page-menu-btn:hover {
    background: var(--border);
}

.ve-page-menu-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-primary);
}

.ve-page-menu {
    position: absolute;
    top: 60px;
    right: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px var(--shadow-lg);
    padding: 8px;
    min-width: 220px;
    z-index: 100;
    animation: fadeInDown 0.2s ease;
}

.ve-page-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.ve-page-action:hover {
    background: var(--background);
}

.ve-page-action svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.ve-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal */
.ve-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ve-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.ve-modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.ve-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ve-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.ve-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--background);
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.ve-modal-close:hover {
    background: var(--border);
    transform: rotate(90deg);
}

.ve-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.ve-modal-body::-webkit-scrollbar {
    width: 8px;
}

.ve-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.ve-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.ve-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Form */
.ve-form-section {
    margin-bottom: 40px;
}

.ve-form-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--text-primary);
}

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

.ve-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.ve-form-group input[type="text"],
.ve-form-group input[type="email"],
.ve-form-group input[type="tel"],
.ve-form-group input[type="url"],
.ve-form-group input[type="time"],
.ve-form-group input[type="date"],
.ve-form-group select,
.ve-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
}

.ve-form-group input:focus,
.ve-form-group select:focus,
.ve-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.ve-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.ve-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Upload */
.ve-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.ve-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.ve-upload-placeholder svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    stroke: var(--text-secondary);
}

.ve-upload-placeholder p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

#ve-logo-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius);
}

/* Media Grid */
.ve-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ve-media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--background);
}

.ve-media-item img,
.ve-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ve-remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 59, 48, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.ve-remove-media:hover {
    background: var(--error-color);
    transform: scale(1.1);
}

/* Horaires */
.ve-horaires-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ve-horaires-reguliers,
.ve-horaires-exceptionnels {
    background: var(--background);
    padding: 20px;
    border-radius: var(--radius);
}

.ve-horaires-reguliers h4,
.ve-horaires-exceptionnels h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
}

.ve-horaire-row,
.ve-exceptionnel-row {
    display: grid;
    grid-template-columns: 120px 1fr auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.ve-horaire-row span,
.ve-exceptionnel-row span {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.ve-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.ve-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ve-remove-horaire {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    color: var(--error-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ve-remove-horaire:hover {
    background: var(--error-color);
    color: white;
}

.ve-remove-horaire svg {
    width: 16px;
    height: 16px;
}

/* Modal Footer */
.ve-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ve-auto-save {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0;
    transition: var(--transition);
}

.ve-auto-save.saving {
    opacity: 1;
}

.ve-auto-save svg {
    width: 16px;
    height: 16px;
    stroke: var(--success-color);
}

.ve-modal-actions {
    display: flex;
    gap: 12px;
}

/* Notifications */
.ve-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 10001;
}

.ve-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.ve-notification-success {
    background: var(--success-color);
    color: white;
}

.ve-notification-error {
    background: var(--error-color);
    color: white;
}

.ve-notification-info {
    background: var(--primary-color);
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ve-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .ve-pages-grid {
        grid-template-columns: 1fr;
    }
    
    .ve-form-row {
        grid-template-columns: 1fr;
    }
    
    .ve-horaires-container {
        grid-template-columns: 1fr;
    }
    
    .ve-horaire-row,
    .ve-exceptionnel-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ve-modal-content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
}