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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #8b5cf6;
    --dark: #0f172a;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: transparent;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
}

.tagline {
    font-size: 0.85rem;
    color: var(--gray);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

.btn-admin {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-admin:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Hero */
.hero {
    position: relative;
    padding: 10rem 0 6rem;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.4);
}

/* Filter */
.filter-section {
    padding: 2rem 0;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid var(--gray-light);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--dark);
    font-family: inherit;
    font-size: 1rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Demos */
.demos-section {
    padding: 3rem 0 5rem;
}

.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.demo-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.demo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.demo-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.demo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.demo-card:hover .demo-image {
    transform: scale(1.1);
}

.demo-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.demo-content {
    padding: 1.5rem;
}

.demo-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.demo-description {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.demo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.demo-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.demo-link:hover {
    gap: 0.8rem;
}

.demo-tags {
    display: flex;
    gap: 0.5rem;
}

.demo-tag {
    background: var(--gray-light);
    color: var(--gray);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.no-demos {
    text-align: center;
    padding: 4rem;
    color: var(--gray);
}

.no-demos i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 4rem 0 1.5rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.footer-section p {
    color: var(--gray-light);
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
}

/* Admin Styles */
.admin-page {
    background: #f1f5f9;
    min-height: 100vh;
}

.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
}

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

.login-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.error-message {
    background: #fee;
    color: var(--danger);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger);
}

/* Admin Dashboard */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 1rem 1.5rem;
    color: var(--gray-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-add {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #059669;
    transform: translateY(-2px);
}

.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--dark);
}

.table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-edit:hover,
.btn-delete:hover {
    transform: scale(1.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-light);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-light);
}

.btn-cancel {
    padding: 0.8rem 1.5rem;
    background: var(--gray-light);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Image Upload */
.image-source-btns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.image-source-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-light);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.image-source-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area i {
    font-size: 2rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.image-preview {
    margin-top: 1rem;
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .demos-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
