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

body {
    background-color: #121212; /* Darker background */
    background-image: radial-gradient(circle at 1px 1px, rgba(138, 43, 226, 0.05) 1px, transparent 0);
    background-size: 25px 25px;
    color: #f0f0f0; /* light grey for text */
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background-color: #111;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #8a2be2;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav a {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #8a2be2; /* violet */
}

main {
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
    border-radius: 15px; /* more rounded corners */
    background-color: rgba(28, 35, 51, 0.6); /* Slightly more opaque */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    border: 1px solid rgba(138, 43, 226, 0.1); /* Even more subtle border */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.4s ease, filter 0.4s ease;
}

section:hover:not(#games):not(#apps) {
    transform: translateY(-5px);
    filter: grayscale(100%);
}

h1, h2, h3 {
    color: #8a2be2; /* violet */
    border-bottom: 2px solid #8a2be2;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

a {
    color: #8a2be2; /* violet */
}

a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    background-color: #111;
    border-top: 1px solid #8a2be2;
}

#hero {
    text-align: center;
    background: linear-gradient(135deg, #1c2333 0%, #2a344a 100%);
    padding: 4rem 2rem;
    border-radius: 8px; /* Match other sections */
}

#hero:hover {
    transform: none;
}

#hero h1 {
    font-size: 3rem;
    border: none;
}

#games, #apps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-container, .app-container {
    background-color: #1c2333;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#projects-container, #tic-tac-toe-board, #chess-board, #calculator, #search-results {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #1c2333;
    border-radius: 5px;
    min-height: 100px;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #808080; /* grey */
    background-color: #2a344a;
    color: #f0f0f0;
    box-sizing: border-box;
}

/* Project cards styling */
#projects .project-card {
    background-color: #1c2333;
    border: 1px solid #8a2be2;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#projects .project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

#projects .project-card h3 a {
    text-decoration: none;
    color: #8a2be2;
}

#projects .project-card p {
    color: #f0f0f0;
    flex-grow: 1; /* Makes p take available space */
}

#projects .project-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #808080; /* grey */
}

/* --- Game Styling --- */
.game-status {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    min-height: 20px;
    font-weight: bold;
}

.restart-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #8a2be2;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.restart-btn:hover {
    background-color: #6a1eae;
}

/* Tic-Tac-Toe game styling */
#tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.tic-tac-toe-cell {
    background-color: #2a344a;
    border: 2px solid #8a2be2;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
}

.tic-tac-toe-cell:hover {
    background-color: #3e4a6a;
}

/* Chess game styling */
#chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    max-width: 400px;
    margin: 20px auto;
    border: 5px solid #6a1eae;
    aspect-ratio: 1 / 1;
}

.chess-square {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chess-square.light {
    background-color: #f0d9b5;
}

.chess-square.dark {
    background-color: #b58863;
}

/* Calculator App Styling */
.calculator {
    max-width: 300px;
    margin: 0 auto;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: #1c2333;
}

.calculator-display {
    background-color: #2a344a;
    color: white;
    font-size: 2.5rem;
    text-align: right;
    padding: 20px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    word-wrap: break-word;
    word-break: break-all;
}

.calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calculator-keys button {
    height: 60px;
    border-radius: 5px;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    background-color: #3e4a6a;
    color: white;
    transition: background-color 0.2s;
}

.calculator-keys button:hover {
    background-color: #4a5a7a;
}

.key--operator {
    background-color: #8a2be2;
}
.key--operator:hover {
    background-color: #9a3be2;
}

.key--equal {
    background-color: #6a1eae;
}
.key--equal:hover {
    background-color: #7a2eae;
}

.key--zero {
    grid-column: span 2;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #8a2be2; /* violet */
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
}

/* Search highlight styling */
mark {
    background-color: #8a2be2;
    color: white;
    padding: 2px;
    border-radius: 3px;
}

.chess-piece {
    font-size: 36px; /* Adjust size as needed */
    line-height: 1;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    cursor: grab;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.chess-square.selected {
    background-color: #8a2be2 !important; /* A strong highlight */
    box-shadow: inset 0 0 10px #00000080;
}

.valid-move {
    position: relative;
}

.valid-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background-color: rgba(138, 43, 226, 0.5);
    pointer-events: none; /* Allows clicking through the dot */
}

.chess-square.in-check {
    background-color: #ff4d4d !important;
    box-shadow: inset 0 0 10px #00000080;
}

/* Gallery Styling */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.gallery-item {
    display: block;
    background-color: #2a344a;
    padding: 2rem;
    border-radius: 10px;
    text-decoration: none;
    color: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.gallery-item h3 {
    color: #8a2be2;
    border-bottom: none;
    margin-top: 0;
}

.search-container {
    padding: 0 1rem 1rem 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Todo List App Styling */
.todo-container {
    max-width: 600px;
    margin: 0 auto;
}

#todo-form {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

#todo-input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #808080;
    background-color: #2a344a;
    color: #f0f0f0;
    font-size: 1rem;
}

#todo-form button {
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #8a2be2;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#todo-form button:hover {
    background-color: #6a1eae;
}

#todo-list {
    list-style: none;
    padding: 0;
}

#todo-list li {
    background-color: #2a344a;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    word-break: break-all;
}

#todo-list li.completed {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: #1c2333;
}

#todo-list .delete-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
    transition: background-color 0.3s;
}

#todo-list .delete-btn:hover {
    background-color: #cc0000;
}
