/* Preload class to prevent flash of white */
.preload * {
    transition: none !important;
}

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --nav-hover: #ADD8E6;
    --card-bg: #f8f8f8;
    --link-color: #0066cc;
    --tag-bg: #e6e6e6;
    --tag-text: #333333;
    --tag-border: #cccccc;
}

.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --nav-hover: #2c5364;
    --card-bg: #1e1e1e;
    --link-color: #4da6ff;
    --tag-bg: #2a2a2a;
    --tag-border: #444444;
}

body {
    padding-top: 2%;
    padding-left: 5%;
    padding-bottom: 3%;
    padding-right: 2%;
    font-family: Roboto, Verdana, sans-serif;
    font-size: 14px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1 {
    font-size: 22px;
}

h3 {
    font-size: 18px;
}

p {
    text-align: justify;
    font-size: 14px;
}

.navbar {
    width: 200px;
    position: fixed;
    text-align: left;
    font-size: 14px;
}

.navlink {
    display: inline-block;
    width: 100%;
    text-decoration: none;
    padding-left: 10px;
}

.navlink:hover {
    background-color: var(--nav-hover);
}

.profile-picture {
    width: 150px;
    height: 150px;
    margin: 10px 0;
    display: block;
    border-radius: 0;
}

.main {
    margin-left: 220px;
    max-width: 635px; 
}

/* Theme switcher button */
.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-switch:hover {
    transform: scale(1.1);
}

.theme-switch .icon {
    font-size: 20px;
    transition: all 0.3s ease;
}

.dark-theme .theme-switch .icon-sun {
    display: none;
}

.dark-theme .theme-switch .icon-moon {
    display: inline;
}

.theme-switch .icon-sun {
    display: inline;
}

.theme-switch .icon-moon {
    display: none;
}

/* Hide checkbox but use it for state */
#theme-toggle {
    display: none;
}

/* When checkbox is checked, apply dark theme */
#theme-toggle:checked ~ body {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --nav-hover: #2c5364;
    --card-bg: #1e1e1e;
    --link-color: #4da6ff;
    --tag-bg: #333333;
    --tag-text: #e0e0e0;
}

/* Style for links */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Responsive styling */
@media screen and (max-width: 768px) {
    body {
        padding: 5% 4%;
        font-size: 16px;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h3 {
        font-size: 20px;
        margin-top: 20px;
    }
    
    p {
        margin-bottom: 15px;
    }
    
    ul {
        padding-left: 20px;
    }
    
    .theme-switch {
        top: 15px;
        right: 15px;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    body {
        padding: 6% 5%;
        font-size: 15px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .theme-switch {
        top: 10px;
        right: 10px;
    }
    
    .tag {
        padding: 3px 8px;
        margin: 2px;
        font-size: 11px;
    }
    
    .card {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    ul li {
        margin-bottom: 10px;
    }
}

.tags {
    margin-top: 10px;
    text-align: center; /* Center the tags */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    border-radius: 12px;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    font-size: 12px;
    border: 1px solid var(--tag-border);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-weight: 600;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}