:root {
    --primary: #003d5b;
    --accent: #3b82f6;
    --bg-app: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius: 16px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Sidebar Design */
.sidebar {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-top {
    padding: 25px;
    text-align: center;
}

.logo-main {
    height: 45px;
    margin-bottom: 20px;
}

.nav-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 12px;
    margin: 0 25px 20px;
}

.nav-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-box {
    margin: 0 25px 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.item-card.active {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.item-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.add-btn-container {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-primary {
    width: 100%;
    border: none;
    background: var(--primary);
    color: white;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #002d45;
}

/* Main Area */
.main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.welcome-screen svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    display: none;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    border-bottom: 1px solid #f1f5f9;
}

.header-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.header-info span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--accent);
    color: var(--accent);
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 25px;
    flex: 1;
}

.preview-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.card-title h3 {
    font-size: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-box {
    flex: 1;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    position: relative;
}

.copy-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

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

.modal-content {
    background: white;
    width: 95%;
    max-width: 600px;
    border-radius: 20px;
    padding: 40px;
    position: relative;
}

.modal-header {
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 1.6rem;
    color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
}

.form-group.full {
    grid-column: span 2;
}

.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
    transition: 0.4s ease-out;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}