:root {
	--primary: #3b82f6;
	--primary-hover: #2563eb;
	--text-main: #1e293b;
	--text-sub: #64748b;
	--marker-arrow: #64748ba2;
	--border: #e2e8f0;
	--bg-color: #f4f6f8;
	--card-bg: #ffffff;
	--grid-dot: #cbd5e1;
	--info-icon: #a0bad8;
}

* {
	box-sizing: border-box;
	scrollbar-gutter: stable;
}

body {
	font-family: "Space Grotesk", sans-serif;
	background-color: var(--bg-color);
	padding: 40px;
	margin: 0;
	height: 100vh;
}

#logo {
	aspect-ratio: 1;
	width: 60px;
	border-radius: 10px;
	margin-bottom: 10px;
}

#app {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

#header-container,
.tabs-container,
#overview-view,
#alignment-view {
	max-width: 950px;
	margin-left: auto;
	width: 100%;
	margin-right: auto;
}


#flow-view {
	flex: 1;
	width: 100%;
	
}


.project-header {
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}

.project-title {
	font-size: 1.8rem;
	font-weight: 800;
	color: var(--text-main);
	margin: 0;
	line-height: 1;
	text-wrap: balance;
}


.tabs-container {

	gap: 10px;
	display: flex;
	margin: 25px 0px;
	max-width: 950px;
	margin-left: auto;
	margin-right: auto;
}

.settings-btn {
	background: transparent;
	position: absolute;
	right: 40px;
	top: 40px;
	font-family: "Space Grotesk", -apple-system, sans-serif;
	font-weight: bold;
	border: 1px solid transparent;
	color: var(--text-sub);
	padding: 8px;
	border-radius: 20px;
	font-weight: 600;
	display: flex;
	cursor: pointer;
}

.settings-btn:hover {
	background: #e2e8f0;
	color: var(--text-main);
}

.settings-btn.active {
	background: var(--text-main);
	color: white;
}

.tab-btn {
	background: transparent;
	font-family: "Space Grotesk", -apple-system, sans-serif;
	font-weight: bold;
	border: 1px solid transparent;
	color: var(--text-sub);
	padding: 6px 16px;
	border-radius: 20px;
	font-weight: 600;
	cursor: pointer;
}

.tab-btn:hover {
	background: #e2e8f0;
	color: var(--text-main);
}

.tab-btn.active {
	background: var(--text-main);
	color: white;
}


.view-section {
	display: none;
	animation: fadeIn 0.2s ease-in-out;
}

.view-section.active {
	display: block;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}


.btn-action {
	font-family: "Space Grotesk", -apple-system, sans-serif;
	font-weight: bold;
	background: var(--card-bg);
	border: 1px solid var(--border);
	color: var(--text-main);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 0.8rem;
	cursor: pointer;
}

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


.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s;
	backdrop-filter: blur(2px);
}

.modal-overlay.open {
	opacity: 1;
	visibility: visible;
}

.modal-card {
	background: #fff;
	width: fit-content;
	max-height: 85vh;
	min-width: 900px;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: scale(0.95);
	transition: transform 0.2s;
}

.modal-overlay.open .modal-card {
	transform: scale(1);
}

.modal-header {
	padding: 15px 20px;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f8fafc;
}

.modal-title {
	font-weight: 700;
	color: var(--text-main);
}

.close-btn {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--text-sub);
}

.modal-body {
	padding: 0;
	overflow-y: auto;
	background: #fff;
}

.modal-body-analyse-selection {
	position: absolute;
	right: 20px;
	opacity: 0;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: bold;
	border-radius: 5px;
	outline: none;
	background: transparent;
	color: var(--primary);
	cursor: pointer;
	border: 2px dashed var(--primary);
	bottom: 20px;
	width: 180px;
	height: 40px;
}

.modal-body-analyse-selection.active {
	opacity: 1;
}


.snippet-view-meta {
	padding: 10px 20px;
	background: #f1f5f9;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-sub);
}

.meta-left {
	display: flex;
	align-items: center;
	gap: 6px;
}

.snippet-github-link {
	text-decoration: none;
	background-color: #010409;
	color: white;
	margin-left: 4px;
	padding: 6px 10px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8rem;
}

.markdown-body pre {
	margin: 0;
	padding: 20px;
	background: #282c34 !important;
}

.markdown-body code {
	font-family: "JetBrains Mono", monospace;
	text-wrap: balance;
}

.markdown-body code::selection,
.markdown-body code::-moz-selection,
.markdown-body code span::selection,
.markdown-body code span::-moz-selection {
	color: var(--primary);
	background-color: #4d54646e;
}

.loading-text {
	padding: 40px;
	text-align: center;
	color: var(--text-sub);
	font-style: italic;
}

#toast-container {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.toast-notification {
	pointer-events: auto;
	background: var(--card-bg);
	color: var(--text-main);	
	padding: 12px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: "Space Grotesk", sans-serif;
	font-weight: 500;
	font-size: 0.9rem;

	max-width: 350px;

	opacity: 0;
	transform: translateY(20px);
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

	flex-shrink: 0;
}

.toast-notification.info {
	border: 1px solid var(--border);
	border-left: 4px solid var(--primary);
}

.toast-notification.success {
	border: 1px solid #10b981;
	border-left: 4px solid #10b981;
}

.toast-notification.error {
	border: 1px solid #ef4444;
	border-left: 4px solid #ef4444;
}

.toast-notification.show {
	opacity: 1;
	transform: translateY(0);
}

.toast-icon {
	color: var(--primary);
	display: flex;
	align-items: center;
}


#selection-popup-btn {
    position: fixed;
    z-index: 2100; 
    background: var(--text-main);
    color: #010409;
		font-family: 'Space Grotesk', sans-serif;
		background-color: white;
		border: 2px dashed var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none; 
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

#selection-popup-btn:hover {
    background: rgb(189, 189, 189);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}


.floating-analysis-window {
    position: fixed;
    z-index: 2200; 
    width: 320px;
    height: 400px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Space Grotesk', sans-serif;
    animation: fadeIn 0.2s ease-out;
}

.floating-header {
    background: #f1f5f9;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; 
    user-select: none;
}

.floating-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-close-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.floating-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #fff;
}


.floating-content p { margin: 10px; }
.floating-content pre { 
    background: #1e293b; 
    color: white; 
    padding: 10px; 
    border-radius: 4px; 
    overflow-x: auto; 
    font-size: 0.8rem;
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-sub);
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#project-carousel {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
		transition: opacity ease 0.1s;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background-color: var(--grid-dot);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.carousel-dot:hover {
    background-color: var(--text-sub);
    transform: scale(1.1);
}

.carousel-dot.active {
    background-color: var(--text-main);
    transform: scale(1.3);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

@media (max-width: 768px) {
    body {
        padding: 2rem;
        height: auto;
        height: 100vh;
    }

    .settings-btn {
        top: 15px;
        right: 15px;
    }

    .tabs-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        margin: 15px 0;
    }

    .modal-card {
        min-width: 0;
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .snippet-view-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .project-title {
        font-size: 1.4rem;
        padding-right: 40px;
    }
    
    #toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        align-items: center;
    }
    
    .toast-notification {
        max-width: 100%;
        width: 100%;
    }
    
    #project-carousel {
        width: 90%;
        justify-content: center;
    }
}
