/* General Styles */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Light Theme (Default) */
body.light-theme {
    background-color: #f4f4f4;
    color: #333;
}

/* Dark Theme */
body.dark-theme {
    background-color: #222;
    color: #eee;
}

body.dark-theme header {
    background-color: #333;
    border-bottom: 1px solid #444;
}

body.dark-theme .project-card {
    background-color: #333;
    border: 1px solid #444;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

body.dark-theme .project-card h3 {
    color: #eee;
}

body.dark-theme .project-card p {
    color: #ccc;
}

body.dark-theme .project-card .language {
    background-color: #555;
    color: #eee;
}

body.dark-theme a {
    color: #64b5f6; /* Lighter blue for dark theme links */
}

body.dark-theme footer {
    background-color: #333;
    color: #ccc;
    border-top: 1px solid #444;
}

body.dark-theme #theme-toggle {
    background-color: #555;
    color: #eee;
    border: 1px solid #666;
}

body.dark-theme #theme-toggle:hover {
    background-color: #666;
}

/* Header */
header {
    background-color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s, border-bottom 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
}

#user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #ddd;
}

#username {
    margin: 0;
    font-size: 1.5em;
}

#github-link {
    margin-left: 20px;
    text-decoration: none;
    color: #0366d6;
    font-weight: bold;
}

#github-link:hover {
    text-decoration: underline;
}

#theme-toggle {
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #eee;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

#theme-toggle:hover {
    background-color: #ddd;
}

/* Main Content */
main {
    padding: 20px;
    flex-grow: 1;
}

#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes language to the bottom */
    min-height: 200px; /* Ensure cards have a minimum height */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.project-card .logo {
    max-width: 80px; /* Increased from 50px */
    max-height: 80px; /* Increased from 50px */
    margin-bottom: 10px;
    align-self: flex-start; /* Align logo to the top left */
    position: relative;
    overflow: hidden;
    border-radius: 15%; /* Slightly rounded corners for glossy effect */
    transition: all 0.3s ease;
}

.project-card .logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
    z-index: 2;
}

.project-card .logo::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 220%;
    height: 220%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.5) 41%,
        rgba(255, 255, 255, 0.9) 100%
    );
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0.8;
    border-radius: 30%;
    z-index: 1;
}

.project-card:hover .logo {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 24px -6px rgba(0,0,0,0.3);
    filter: brightness(1.05);
}

.project-card:hover .logo::before {
    left: 100%;
}

.project-card:hover .logo::after {
    opacity: 1;
    transform: rotate(45deg) translate(20px, 20px);
    filter: blur(1px);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    transition: color 0.3s;
}

.project-card p {
    margin-bottom: 15px;
    flex-grow: 1; /* Allows description to take available space */
    color: #555;
    transition: color 0.3s;
}

.project-card a {
    text-decoration: none;
    color: #0366d6;
    font-weight: bold;
    display: block; /* Make link take full width */
    margin-bottom: 10px; /* Space between link and language */
}

.project-card a:hover {
    text-decoration: underline;
}

.project-card .language {
    font-size: 0.9em;
    background-color: #eee;
    color: #555;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block; /* Fit content width */
    margin-top: auto; /* Pushes to the bottom */
    transition: background-color 0.3s, color 0.3s;
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    background-color: #eee;
    color: #555;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    transition: background-color 0.3s, color 0.3s, border-top 0.3s;
}
