/*Roboto*/
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
  } 

 /* DEMO Font */
 @font-face {
    font-family: 'Demo';
    src: url('../fonts/DEMO-bgt45.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'Demo';
    src: url('../fonts/DEMO-bgt65.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
  }
 
 /* Reset and base styles */
 :root {
    --max-content-width: 1200px;
    --text-color: #333;
    --border-color: #e0e0e0;
    --primary-color: #2c3e50;
    --background-color: #0a0a0f;/* #f5f5f5;*/
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    outline: none;
    caret-color: transparent;
}

footer {
    position: fixed;
    width: 100%;
    bottom: 0;
    text-align: center;
    padding: 10px;
    margin-top: 40px;
    /* color: #666; */ /* theme light */
    /* background-color: #e3e3e3; */ /* theme light */
    color: #636b76;
    background-color: #0d1a29;
}

footer a, footer a:visited {
  color: #52978a;
}

footer a:hover, footer a:active {
  color: #5ac7b3;
}

/* Burger menu styles */
.burger-menu {
    display: none;
    cursor: pointer;
    padding: 10px;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* Header section */
.header {
    position: relative;
    text-align: center;
    padding-bottom: 100px;
    padding-top: 30px;
    /* background-color: #c6ced7; */ /* theme light */
    /* background-color:#0d1a29; */
    background: linear-gradient(90deg, #0d1a29, #0d1a29, #12263f 50%, #0d1a29, #0d1a29);
}

.title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-family: Arial, sans-serif; 
    display: inline-block;
    position: relative;
    padding-bottom: 5px;
    /* color: #21272c; */ /* theme light */
    color: #c7c7c7;
}

.description {
    font-family: 'Roboto', Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    color: #86919f; /* #636b76; */
}

/* Index button */
.home-button {
    position: absolute;
    top: 65px;
    left: calc(50% - 532px);
    transform: translate(-50%, -50%);
    text-decoration: none;
}

.blackhole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgb(10, 10, 15);
    box-shadow: 0 0 30px 5px rgba(0, 78, 255, 0.4);
    /* box-shadow: 0 0 0 0.6em rgba(0, 78, 255, 0.05), 0 0 0 1.2em rgba(0, 78, 255, 0.05), 0 0 0 1.8em rgba(0, 78, 255, 0.05); */
    cursor: pointer;
    z-index: 1;
    transition: box-shadow 0.3s linear;
  }

  .home-button:hover .blackhole {
    box-shadow: 0 0 30px 5px rgb(60 185 158);
    /* box-shadow: 0 0 0 0.3em rgba(60, 185, 158, 0.5), 0 0 0 0.6em rgba(60, 185, 158, 0.4), 0 0 0 0.9em rgba(60, 185, 158, 0.3), 0 0 0 1.2em rgba(60, 185, 158, 0.2), 0 0 0 1.5em rgba(60, 185, 158, 0.1), 0 0 0 1.8em rgba(60, 185, 158, 0.05); */
  }

  .home-button:hover .section-title-text {
    color:#c7c7c7;
  }

.section-title-text {
    font-family: 'Demo', Arial, sans-serif;
    margin: 0 0;
    color:#304459; /* #2c3e50;*/
    font-size: 1.8rem;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
    padding: 5px 20px;
    border-radius: 5px;
    z-index: 5;
    transition: color 0.3s linear;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 3.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: #c7c7c7;
    width: 40px;
    height: 40px;
    border-radius: 50%;
	border-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #34495e;
}

/* header separator */
.section-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.section-line-right {
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, #3c618b, #425e7d, #3d4965 50%, #3e4751, #1d2c3d);
}

.section-line-left {
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, #1d2c3d, #3e4751, #3d4965 50%, #425e7d, #3c618b);
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    min-height: 100vh;
}

/* Tab styles */
.tabs-container {
    position: relative;
    height: 2px;
    background: rgb(62 77 105);
    margin: 20px 0;
    top: -42px;
}

.tabs-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4e5c6b, #40868b, #3bd8a9);
    transition: width 0.5s ease;
    width: 0%;
}

.tabs-anti-progress {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #3bd8a9, #40868b, #4e5c6b); 
    transition: width 0.5s ease;
    width: 100%;
}

.tabs {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    color: #304459;
    position: relative;
    margin-top: -30px;
    height: 60px;
    background-color: #0a0a0f;
    /* border-radius: 25px; */
    font-family: 'Demo';
    font-size: 1.8rem;

    transform: scale(1);
    /* clip-path: polygon(10% 0%, 100% 0%, 90% 0%, 100% 30%, 100% 100%, 30% 100%, 0% 70%, 0% 30%); */
    /* clip-path: polygon(5% 0%, 100% 0%, 95% 0%, 100% 15%, 100% 100%, 30% 100%, 0% 70%, 0% 15%); */
    clip-path: polygon(10% 0%, 100% 0%, 90% 0%, 100% 50%, 100% 100%, 30% 100%, 0% 70%, 0% 50%);
}

.tab.active {
    color: #666;
    
}

.tab::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.8), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.5s ease;
  }

 .tab.active::before {
    transform: scaleX(1);
}

.tab-index-mobile {
	visibility: hidden;
	display: none;
	cursor: pointer;
    border: none;
    color: #304459;
    position: relative;
    margin-top: -30px;
    height: 60px;
    background-color: #0a0a0f;
    font-family: 'Demo';
    font-size: 1.8rem;
    transform: scale(1);
	width: 100%;
    text-align: left;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
	text-decoration: none;
}

/* Content area styles */
.content {
    display: none;
    padding: 20px 0;
}

.content.active {
    display: block;
}

/* Chapter list styles */
.chapter {
    margin-bottom: 20px;
    border: 1px solid #122f3d; /* #eee;*/
    border-radius: 3px;
    overflow: hidden;
    color: #c7c7c7;
}

.chapter.read .chapter-header, 
.chapter.current .chapter-header {
    background-color: #102136
}

.chapter:hover {
    box-shadow: 0 0 18px rgba(100, 110, 255, 0.3);
    border-color: rgba(100, 172, 255, 0.4);
}

.chapter-header {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: transparent; /* #f8f9fa;*/
    cursor: pointer;
}

.chapter-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

.chapter-title {
    flex-grow: 1;
    font-weight: normal;
}

.chapter-content {
    display: none;
    padding: 20px;
}

.chapter.open .chapter-content {
    display: flex;
}

.last-read {
    font-size: 0.8rem;
    color: #2f878a; /* #666;*/
    margin-top: 5px;
}

.pages-list {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    border-right: 1px solid #86919f;
    padding-right: 20px;
}

.pages-list::-webkit-scrollbar {
    width: 8px;
}

.pages-list::-webkit-scrollbar-track {
    background: #666666;
    border-radius: 2px;
}

.pages-list::-webkit-scrollbar-thumb {
    background: #313131;
    border-radius: 2px;
}

.pages-list::-webkit-scrollbar-thumb:hover {
    background: #161616;
}

.page-link {
    display: block;
    padding: 8px 12px;
    margin: 4px 0;
    color:  #86919f;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
}

.page-link:hover {
    color: #3aa1a5;
    border: 1px solid rgba(100, 172, 255, 0.4);
}

.page-link.current {
    background-color: #1a203d;
    color: #2198bf;
    font-weight: 500;
    padding-right: 140px; /* Make room for the badge */
    position: relative;
    border: 1px solid var(--primary-color);
}

.page-link.current::after {
    content: 'Reprise lecture';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #811236;
    color: #c7c7c7;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.summary {
    flex: 2;
    padding-left: 30px;
}

.spoiler {
    background-color: #1a203d;
    color: transparent;
    padding: 2px 4px;
    cursor: pointer;
    user-select: none;
}

.spoiler:hover {
    background-color: transparent;
    color: #2198bf;
}
.spoiler-box {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #1a203d;
    color: transparent;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 2px;
}

.spoiler-box::before {
    content: 'SPOILER';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0.7;
    pointer-events: none;
}

.spoiler-box:hover {
    background: rgb(24 120 125);
}

.spoiler-box.revealed {
    background: transparent;
    color: #2198bf;
    user-select: text;
}

.spoiler-box.revealed::before {
    display: none;
}

/* Character tab styles */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    
}

.character-card {
    display: flex;
    align-items: start;
    gap: 20px;
}

.character-info h3 {
    color: #c7c7c7;
}

.character-info p {
    color: #86919f;
}

.character-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

/* Gallery tab styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.locked-info {
    color:#86919f;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    cursor: pointer;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80vh;
}

.modal.active {
    display: block;
}

/* Responsive design */
@media (max-width: 768px) {
    .burger-menu {
        display: block;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background-color: rgb(10, 10, 15);
		box-shadow: 0 0 30px 5px rgba(0, 78, 255, 0.4);
		border-width: 0;
		color: #c7c7c7;
    }
	
	/* Overlay when menu is open */
	.container::before,
	.header::before,
	footer::before	{
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0);
		pointer-events: none;
		transition: background-color 0.3s ease;
		z-index: 5;
	}

	/* Apply overlay when menu is open */
	body:has(.tabs.active) .container::before, 
	body:has(.tabs.active) .header::before,
	body:has(.tabs.active) footer::before	{
		background-color: rgba(0, 0, 0, 0.7);
		pointer-events: auto;
	}
	
	body:has(.tabs.active) {
		overflow: hidden;	
	}
	
	.tabs-container {
		margin: 20px -20px;
	}

    .tabs {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100%;
		background: #0a0a0f;
		/* background: linear-gradient(90deg, #0a0a0f, #0d1a29, #12263f 50%); */
        flex-direction: column;
        padding: 100px 20px 20px;
        transition: 0.3s;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .tabs.active {
        left: 0;
    }

    .tab {
        width: 100%;
        text-align: left;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
		clip-path: none;
    }

    .tab.active::after {
        display: none;
    }
	
	.tab-index-mobile {
		visibility: visible;
		display: block;
	}
	
    .chapter-content {
        flex-direction: column;
    }
    
    .summary {
        padding-left: 0;
        padding-top: 20px;
    }

    .character-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header {
		padding: 20px;
        /* margin-left: 40px; */
    }
	
	.section-line-left, 
	.section-line-right {
		visibility: hidden;
	}
	
	.section-title-container {
		width: inherit;
	}
	
	.title {
		padding-top: 2rem;
	}
}