* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --success: #10b981;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 25px 30px -12px rgba(0, 0, 0, 0.25);
}

body {
    background: #f1f5f9;
    color: var(--dark);
    min-height: 100vh;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 2rem;
    -webkit-text-fill-color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-links a i {
    font-size: 1.1rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

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

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: white;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-gradient);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.section-header h2 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Form Container */
.create-card-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

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

.form-wrapper, .preview-wrapper {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.form-wrapper:hover, .preview-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.form-header, .preview-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.form {
    padding: 2rem;
}

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

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

.input-group label i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

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

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

/* Preview Card */
.preview-wrapper {
    position: sticky;
    top: 100px;
}

.preview-card {
    padding: 2rem;
}

.preview-image {
    width: 100%;
    height: 200px;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--gray-light);
}

.preview-image img {
    width: 100%;
    height: 200%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.preview-content h4 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.preview-content h5 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.preview-content p {
    color: var(--gray);
    line-height: 1.6;
}

/* Cards Grid */
.cards-section {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 2rem;
}

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

.card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--hover-shadow);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease-in-out;
}

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

.card-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.badge.edit {
    color: var(--warning);
}

.badge.edit:hover {
    background: var(--warning);
    color: white;
    transform: scale(1.1);
}

.badge.delete {
    color: var(--danger);
}

.badge.delete:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.card-content h4 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.card-content p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Login overlay styles */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.login-message {
    text-align: center;
    padding: 2rem;
}

.login-message i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
    display: block;
}

.login-message p {
    font-size: 1rem;
    color: #334155;
}

.login-message a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.login-message a:hover {
    text-decoration: underline;
}

/* Dark theme support */
body.dark-theme .login-overlay {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-theme .login-message p {
    color: #cbd5e1;
}

/* Empty state for login required */
.empty-state i.fa-lock {
    font-size: 4rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.empty-state a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.card-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn.edit:hover {
    background: var(--warning);
    color: white;
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

/* Popup Modal */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.popup-box {
    background: white;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.popup-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 i {
    margin-right: 0.5rem;
}

.close-popup {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-popup:hover {
    transform: rotate(90deg);
}

.popup-content {
    padding: 2rem;
}

.popup-actions {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--gray-light);
}

.popup-actions button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-cancel:hover {
    background: var(--gray);
    color: white;
}

.btn-update {
    background: var(--bg-gradient);
    color: white;
}

.btn-update:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--hover-shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    color: var(--success);
    font-size: 1.25rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray);
}

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

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

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

/* Responsive Design */
@media (max-width: 968px) {
    .form-container {
        grid-template-columns: 1fr;
    }
    
    .preview-wrapper {
        position: static;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .nav-actions .login-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .popup-box {
        width: 95%;
    }
}

/* Dark Theme Variables */
body.dark-theme {
    --light: #1e293b;
    --dark: #f8fafc;
    --gray-light: #334155;
    background: #0f172a;
}

body.dark-theme .navbar,
body.dark-theme .form-wrapper,
body.dark-theme .preview-wrapper,
body.dark-theme .card,
body.dark-theme .popup-box {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-theme .input-group input,
body.dark-theme .input-group textarea {
    background: #334155;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-theme .input-group label {
    color: #cbd5e1;
}

body.dark-theme .card-content h3,
body.dark-theme .card-content h4 {
    color: #f8fafc;
}

body.dark-theme .card-content p {
    color: #cbd5e1;
}

body.dark-theme .card-footer {
    border-color: #334155;
}

body.dark-theme .empty-state {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-theme .empty-state i {
    color: #475569;
}

body.dark-theme .preview-content h4,
body.dark-theme .preview-content h5 {
    color: #f8fafc;
}

body.dark-theme .preview-content p {
    color: #cbd5e1;
}