/* CSS Variables */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: white;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    font-size: 1.5rem;
    margin-right: 15px;
    color: var(--dark-color);
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.language-selector select {
    padding: 5px 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    background-color: white;
    font-size: 0.9rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 60px);
    background-color: white;
    box-shadow: var(--box-shadow);
    overflow-y: auto;
    z-index: 999;
    transition: transform var(--transition-speed);
}

.sidebar-nav ul li {
    border-bottom: 1px solid #eee;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    transition: background-color var(--transition-speed);
}

.sidebar-nav ul li a:hover {
    background-color: #f5f7fa;
}

.sidebar-nav ul li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.sidebar-nav ul li.disabled a {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    transition: margin-left var(--transition-speed);
}

.page {
    display: none;
    padding: 20px;
}

.page.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Home Page */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    text-align: center;
    transition: transform var(--transition-speed);
}

.category-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.category-card p {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.btn-primary:hover {
    background-color: #3a5bd9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-back {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 20px;
}

.btn-back i {
    margin-right: 8px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
}

/* Templates Page */
.templates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.template-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: transform var(--transition-speed);
}

.template-card:hover {
    transform: translateY(-5px);
}

.template-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.template-card p {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Canvas Page */
.canvas-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.section-actions button {
    color: var(--secondary-color);
    transition: color var(--transition-speed);
}

.section-actions button:hover {
    color: var(--primary-color);
}

.section-content {
    min-height: 100px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
}

.section-content[contenteditable="true"] {
    outline: none;
    border-color: var(--primary-color);
}

/* Saved Projects Page */
.saved-projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.saved-project-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    position: relative;
    transition: transform var(--transition-speed);
}

.saved-project-card:hover {
    transform: translateY(-5px);
}

.saved-project-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.saved-project-card p {
    margin-bottom: 15px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.saved-project-actions {
    display: flex;
    gap: 10px;
}

.saved-project-actions button {
    color: var(--primary-color);
    font-weight: 500;
}

.saved-project-actions button.delete {
    color: var(--danger-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 1.3rem;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform var(--transition-speed);
    z-index: 3000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 767px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .category-cards {
        grid-template-columns: 1fr;
    }
    
    .templates-container {
        grid-template-columns: 1fr;
    }
    
    .saved-projects-container {
        grid-template-columns: 1fr;
    }
}