/* === ROOT VARIABLES === */
:root {
    --bg: #f5e9e6;             /* Light pink background color for the entire site */
    --card: #fcefee;           /* Slightly lighter pink for card backgrounds */
    --main: #ff0000;           /* Primary red color for accents and highlights */
    --text-dark: #1e1e1e;      /* Dark gray for main text content */
    --text-light: #ffffff;     /* White for text on dark backgrounds */
    --shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    --transition: all 0.3s ease; /* Smooth transition for interactive elements */
}

/* === BASE STYLES === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modern, readable font stack */
    margin: 0;                  /* Remove default margin */
    background: var(--bg);      /* Apply background color */
    color: var(--text-dark);    /* Set default text color */
    line-height: 1.6;          /* Improve text readability */
}

/* Typography */
h1, h2, h3 {
    color: var(--main);        /* Use primary color for headings */
    margin-top: 0;             /* Remove top margin from headings */
}

h1 {
    color: whitesmoke;         /* Light color for main title */
    font-family: algerian;     /* Decorative font for main title */
    font-size: 50px;           /* Large size for main title */
    display: inline-block;     /* Allow width adjustment */
    box-shadow: var(--shadow); /* Add subtle shadow */
    border-radius: 10px;       /* Round the corners */
    transition: var(--transition); /* Smooth hover effect */
}

h1:hover {
    color: pink;               /* Change color on hover */
    transform: scale(1.05);    /* Slightly enlarge on hover */
}

/* Links and Images */
a {
    text-decoration: none;     /* Remove underline from links */
    color: inherit;            /* Inherit text color */
}

img {
    max-width: 100%;          /* Make images responsive */
    height: auto;             /* Maintain aspect ratio */
    display: block;           /* Remove inline spacing */
}

/* === LAYOUT CONTAINERS === */
.container {
    padding: 2em;             /* Add space around content */
    max-width: 1200px;        /* Limit content width */
    margin: auto;             /* Center the container */
}

.container img {
    height: 350px;            /* Set consistent image height */
}

/* === HEADER & NAVIGATION === */
header, footer {
    background: var(--main);   /* Red background for header/footer */
    color: var(--text-light); /* White text */
    padding: 1em;             /* Add padding */
    text-align: center;       /* Center content */
}

.header {
    display: flex;            /* Use flexbox for layout */
    justify-content: space-between; /* Space items evenly */
    align-items: center;      /* Center items vertically */
    margin-top: 20px;         /* Add top margin */
}

.logo-title {
    display: flex;            /* Use flexbox for logo layout */
    align-items: center;      /* Center items vertically */
    text-decoration: none;    /* Remove link underline */
}

.logo {
    height: 55px;             /* Set logo height */
    width: 100px;             /* Set logo width */
    margin-right: 10px;       /* Add space after logo */
    margin-bottom: 30px;      /* Add space below logo */
    border-radius: 10px;      /* Round logo corners */
}

/* Navigation */
nav a {
    color: var(--text-light); /* White text for nav links */
    padding: 0.5em;           /* Add padding around links */
    width: 120px;             /* Set consistent width */
    margin-left: 1em;         /* Space between nav items */
    display: inline-block;    /* Allow width setting */
    border: 1px solid var(--text-light); /* White border */
    box-shadow: var(--shadow); /* Add shadow */
    border-radius: 10px;      /* Round corners */
    transition: var(--transition); /* Smooth hover effect */
}

nav a:hover {
    color: var(--text-dark);  /* Dark text on hover */
    transform: translateY(-5px); /* Move up on hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Enhanced shadow */
}

/* === MANHWA CARDS === */
.manhwa-card {
    display: inline-block;    /* Allow cards to sit side by side */
    width: 200px;             /* Set card width */
    margin: 1em;              /* Space between cards */
    background: var(--card);  /* Light background */
    box-shadow: var(--shadow); /* Add shadow */
    border-radius: 10px;      /* Round corners */
    overflow: hidden;         /* Hide overflow content */
    transition: var(--transition); /* Smooth hover effect */
}

.manhwa-card:hover {
    transform: translateY(-5px); /* Move up on hover */
}

.manhwa-card img {
    width: 100%;              /* Fill card width */
    height: 250px;            /* Set image height */
    object-fit: cover;        /* Maintain aspect ratio */
}

.manhwa-card h3 {
    margin: 0.8em;            /* Space around title */
    font-size: 1.1em;         /* Slightly larger text */
    color: var(--main);       /* Red text color */
}

/* === GENRES SECTION === */
.genres {
    background: var(--card);  /* Light background */
    padding: 1.5em;           /* Add padding */
    margin: 2em 0;            /* Space above and below */
    border-radius: 10px;      /* Round corners */
}

.genres ul {
    list-style: none;         /* Remove bullets */
    padding: 0;               /* Remove default padding */
    display: flex;            /* Use flexbox */
    flex-wrap: wrap;          /* Allow wrapping */
    gap: 1em;                 /* Space between items */
}

.genres li {
    padding: 0.5em 1em;       /* Add padding */
    background: var(--main);  /* Red background */
    color: white;             /* White text */
    border-radius: 20px;      /* Round corners */
    transition: var(--transition); /* Smooth hover effect */
}

.genres li:hover {
    transform: scale(1.05);   /* Slightly enlarge on hover */
}

/* === TABLE STYLES === */
.table-section {
    background: var(--card);  /* Light background */
    padding: 1.5em;           /* Add padding */
    border-radius: 10px;      /* Round corners */
}

table {
    width: 100%;              /* Full width */
    border-collapse: collapse; /* Remove cell spacing */
    margin-top: 1em;          /* Space above table */
}

th, td {
    padding: 0.75em;          /* Cell padding */
    border: 1px solid #ccc;   /* Light border */
    text-align: left;         /* Left-align text */
}

th {
    background: var(--main);  /* Red background */
    color: white;             /* White text */
}

tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.05); /* Zebra striping */
}

/* === FORM STYLES === */
form {
    max-width: 400px;         /* Limit form width */
    margin: auto;             /* Center form */
}

label {
    display: block;           /* Stack labels */
    margin-bottom: 0.5em;     /* Space below labels */
    font-weight: 500;         /* Medium font weight */
}

input, textarea {
    width: 100%;              /* Full width */
    padding: 0.8em;           /* Add padding */
    margin-bottom: 1em;       /* Space below inputs */
    border: 1px solid #ccc;   /* Light border */
    border-radius: 4px;       /* Round corners */
    transition: var(--transition); /* Smooth focus effect */
}

input:focus, textarea:focus {
    outline: none;            /* Remove default outline */
    border-color: var(--main); /* Red border on focus */
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2); /* Red glow */
}

button {
    background: var(--main);  /* Red background */
    color: white;             /* White text */
    padding: 0.8em 1.5em;     /* Add padding */
    border: none;             /* Remove border */
    border-radius: 4px;       /* Round corners */
    cursor: pointer;          /* Show pointer cursor */
    font-weight: bold;        /* Bold text */
    transition: var(--transition); /* Smooth hover effect */
}

button:hover {
    transform: translateY(-2px); /* Move up on hover */
}

/* === FOOTER STYLES === */
footer a {
    color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
    transition: var(--transition); /* Smooth hover effect */
}

footer a:hover {
    color: white;             /* Full white on hover */
    text-decoration: underline; /* Add underline */
}

/* === CAROUSEL STYLES === */
.carousel {
    position: relative;       /* For absolute positioning of children */
    max-width: 1000px;        /* Limit carousel width */
    margin: 2em auto;         /* Center carousel */
    overflow: hidden;         /* Hide overflow */
    border-radius: 10px;      /* Round corners */
    box-shadow: var(--shadow); /* Add shadow */
}

.carousel-items {
    display: flex;            /* Use flexbox for slides */
    width: 400%;              /* 4 slides × 100% */
    transition: transform 0.5s ease-in-out; /* Smooth slide transition */
}

.carousel-item {
    width: 25%;               /* Each slide takes 1/4 width */
    position: relative;       /* For caption positioning */
}

.carousel-item img {
    width: 100%;              /* Fill slide width */
    height: 500px;            /* Set slide height */
    object-fit: cover;        /* Maintain aspect ratio */
}

.carousel-caption {
    position: absolute;       /* Position over image */
    bottom: 0;                /* Align to bottom */
    width: 100%;              /* Full width */
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); /* Fade to black */
    color: white;             /* White text */
    padding: 1em;             /* Add padding */
}

/* Carousel Controls */
input[type="radio"] {
    display: none;            /* Hide radio buttons */
}

/* Slide transitions */
#slide-1:checked ~ .carousel-items { transform: translateX(0); }      /* First slide */
#slide-2:checked ~ .carousel-items { transform: translateX(-25%); }   /* Second slide */
#slide-3:checked ~ .carousel-items { transform: translateX(-50%); }   /* Third slide */
#slide-4:checked ~ .carousel-items { transform: translateX(-75%); }   /* Fourth slide */

.carousel-nav {
    position: absolute;       /* Position at bottom */
    bottom: 20px;             /* Space from bottom */
    width: 100%;              /* Full width */
    text-align: center;       /* Center dots */
}

.carousel-nav label {
    display: inline-block;    /* Allow width/height */
    width: 14px;              /* Dot width */
    height: 14px;             /* Dot height */
    background: rgba(255, 255, 255, 0.5); /* Semi-transpare<nt white */
    border-radius: 50%;       /* Circular dots */
    margin: 0 8px;            /* Space between dots */
    cursor: pointer;          /* Show pointer cursor */
    transition: var(--transition); /* Smooth hover effect */
}

/* Active dot styling */
#slide-1:checked ~ .carousel-nav label:nth-child(1),
#slide-2:checked ~ .carousel-nav label:nth-child(2),
#slide-3:checked ~ .carousel-nav label:nth-child(3),
#slide-4:checked ~ .carousel-nav label:nth-child(4) {
    background: var(--main);  /* Red background */
    transform: scale(1.2);    /* Slightly larger */
}

.carousel-nav label:hover {
    background: rgba(255, 255, 255, 0.8); /* Brighter on hover */
}

/* === SEARCH BAR === */
.search-bar {
    display: flex;            /* Use flexbox */
    justify-content: center;  /* Center items */
    align-items: center;      /* Center vertically */
    gap: 10px;                /* Space between elements */
}

.search-bar input {
    padding: 10px;            /* Add padding */
    font-size: 1rem;          /* Set font size */
    border-radius: 10px;      /* Round corners */
    border: 1px solid #ccc;   /* Light border */
    width: 250px;             /* Set width */
}

.search-bar button {
    background-color: var(--main); /* Red background */
    color: white;             /* White text */
    padding: 1px;             /* Minimal padding */
    font-size: 1.5rem;        /* Larger icon */
    cursor: pointer;          /* Show pointer cursor */
    transition: var(--transition); /* Smooth hover effect */
}

.search-bar button:hover {
    transform: translateY(-2px); /* Move up on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Add shadow */
    background-color: #d40000; /* Darker red */
}