@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --bg-color: #f7fafc;
    --text-color: #1a202c;
    --header-bg-color: #2d3748;
    --header-text-color: #ffffff;
    --card-bg-color: #ffffff;
    --card-text-color: #1a202c;
    --button-bg-color: #2d3748;
    --button-text-color: #ffffff;
    --link-hover-color: #63b3ed;
}

[data-theme="dark"] {
    --bg-color: #1a202c;
    --text-color: #f7fafc;
    --header-bg-color: #2d3748;
    --header-text-color: #f7fafc;
    --card-bg-color: #2d3748;
    --card-text-color: #f7fafc;
    --button-bg-color: #f7fafc;
    --button-text-color: #1a202c;
    --link-hover-color: #63b3ed;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

header {
    background-color: var(--header-bg-color);
    color: var(--header-text-color);
}

footer {
    background-color: var(--header-bg-color);
    color: var(--header-text-color);
}

button, .filter-btn {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

button:hover, .filter-btn:hover {
    background-color: var(--link-hover-color);
    color: var(--button-text-color);
}

a:hover {
    color: var(--link-hover-color);
}

.project {
    background-color: var(--card-bg-color);
    color: var(--card-text-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.project.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter effect */
.typewriter h1 {
    overflow: hidden; 
    border-right: .15em solid orange; 
    white-space: nowrap; 
    margin: 0 auto; 
    letter-spacing: .15em; 
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: orange; }
}

/* Social icons hover effect */
.social-icons a {
    margin: 0 10px;
    color: var(--header-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: orange;
}

/* Filter button active state */
.filter-btn.active {
    font-weight: bold;
    color: orange;
        }

/* Custom styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

header {
    background: #333;
    color: #fff;
    padding: 10px 0;
    text-align: center;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header nav button {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

header nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

header nav ul li {
    margin: 0 10px;
}

header nav ul li a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
}

header nav ul li a:hover {
    color: #ddd;
}

main {
    padding: 20px;
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    padding: 10px 0;
    background: #333;
    color: #fff;
}

/* Blog section styles */
#search {
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#categories {
    margin-bottom: 20px;
}

#categories ul {
    list-style: none;
    padding: 0;
}

#categories li {
    display: inline;
    margin-right: 10px;
}

#categories a {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

#categories a:hover, #categories a.active {
    background: #333;
    color: #fff;
}

#blog-posts article {
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

#blog-posts article::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #333;
    border-radius: 0 4px 4px 0;
}

#blog-posts h2 {
    margin: 0;
}

#blog-posts p {
    margin: 5px 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main, #blog-posts article {
    animation: fadeIn 0.5s ease-in-out;
}

/* Pagination styles */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#pagination button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    background: #333;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

#pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#pagination button:hover:not(:disabled) {
    background: #555;
}

#page-info {
    font-weight: bold;
}

/* Responsive styles */
@media (max-width: 600px) {
    header nav ul {
        flex-direction: column;
        display: none;
    }

    header nav ul li {
        margin: 10px 0;
    }

    header nav button {
        display: block;
    }

    header nav ul.open {
        display: flex;
    }
    }
