* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Neumorphic Color Palette */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b92a8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #e0e5ec;
    --surface: #e0e5ec;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #cbd5e0;

    /* Neumorphic Shadows */
    --shadow-light: -8px -8px 16px rgba(255, 255, 255, 0.8);
    --shadow-dark: 8px 8px 16px rgba(163, 177, 198, 0.6);
    --shadow-inset-light: inset -4px -4px 8px rgba(255, 255, 255, 0.5);
    --shadow-inset-dark: inset 4px 4px 8px rgba(163, 177, 198, 0.4);
    --shadow-sm: -4px -4px 8px rgba(255, 255, 255, 0.8), 4px 4px 8px rgba(163, 177, 198, 0.6);
    --shadow-md: -8px -8px 16px rgba(255, 255, 255, 0.8), 8px 8px 16px rgba(163, 177, 198, 0.6);
    --shadow-lg: -12px -12px 24px rgba(255, 255, 255, 0.8), 12px 12px 24px rgba(163, 177, 198, 0.6);
    --shadow-pressed: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(163, 177, 198, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(163, 177, 198, 0.3);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.actions {
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn:active {
    box-shadow: var(--shadow-pressed);
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(145deg, #7478f7, #6366f1);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    box-shadow: var(--shadow-pressed);
}

.btn-secondary {
    background: var(--surface);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    color: var(--text-primary);
}

.btn-copy {
    background: linear-gradient(145deg, #34d399, #10b981);
    color: white;
    margin-top: 1rem;
}

.btn-copy:hover {
    background: linear-gradient(145deg, #10b981, #059669);
}

.widgets-list h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-card {
    background-color: var(--surface);
    border: none;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.widget-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.widget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.widget-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.widget-type-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(145deg, #7478f7, #6366f1);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: -2px -2px 4px rgba(255, 255, 255, 0.3), 2px 2px 4px rgba(163, 177, 198, 0.4);
}

.widget-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.widget-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.widget-card-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.btn-edit {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    color: white;
}

.btn-edit:hover {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.btn-embed {
    background: linear-gradient(145deg, #34d399, #10b981);
    color: white;
}

.btn-embed:hover {
    background: linear-gradient(145deg, #10b981, #059669);
}

.btn-delete {
    background: linear-gradient(145deg, #f87171, #ef4444);
    color: white;
}

.btn-delete:hover {
    background: linear-gradient(145deg, #ef4444, #dc2626);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--surface);
    border: none;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-pressed);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.empty-state .hint {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background-color: var(--surface);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    border: none;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.close-btn {
    background: var(--surface);
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.close-btn:hover {
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.close-btn:active {
    box-shadow: var(--shadow-pressed);
    transform: scale(0.95);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-pressed);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: var(--shadow-pressed), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    box-shadow: inset -2px -2px 6px rgba(255, 255, 255, 0.5), inset 2px 2px 6px rgba(163, 177, 198, 0.4);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.code-block {
    background: linear-gradient(145deg, #2d3748, #1a202c);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 1rem;
    position: relative;
    box-shadow: var(--shadow-pressed);
}

.code-block pre {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.info-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .widget-grid {
        grid-template-columns: 1fr;
    }

    .modal.active {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
    }
}
