:root {
    /* Dark theme optimized colors */
    --primary-bg: #13141f;
    --secondary-bg: #1a1b25;
    --text-color: #f5f7ff;
    --accent-color: #8b7bff; /* Brightened accent color for better visibility on dark backgrounds */
    --accent-light: #a29bfe;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --card-border: rgba(255, 255, 255, 0.12);
    --glass-bg: rgba(26, 27, 37, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --blob-opacity: 0.3; /* Reduce blob opacity for dark theme */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--blob-opacity);
}

.blob1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.blob2 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, #4ecca3, #4ab1c9);
    bottom: -150px;
    left: -150px;
    animation: float 10s ease-in-out infinite reverse;
}

.blob3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ff9a9e, #a569bd);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 12s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, -20px) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
}

header {
    padding: 20px 5%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.logo h1 {
    font-weight: 400; /* Changed from 700 to 400 for less bold text */
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
    color: var(--text-color); /* Changed to white instead of gradient */
    display: inline-block; /* Allow the h1 to sit next to the project title */
    vertical-align: middle; /* Align vertically */
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 12px;
    clear: both; /* Ensure this starts below both title elements */
}

/* Hide theme toggle since we only use dark theme */
.theme-toggle {
    display: none;
}

/* Style for project title in header */
.project-title {
    font-size: 1.3rem;
    color: var(--text-color); /* Changed to white (text-color variable) */
    font-weight: 500;
    display: inline-block;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid var(--text-color); /* Changed from accent-light to text-color (white) */
    vertical-align: middle;
    opacity: 0.9; /* Increased opacity for better visibility */
    line-height: 1.8rem;
}

main {
    flex: 1;
    padding: 20px 5%;
    margin-bottom: 30px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.search-box i {
    margin-right: 15px;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    position: relative;
    padding: 25px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
    opacity: 0.1;
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.project-card .description {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.project-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card .date {
    font-size: 0.8rem;
    opacity: 0.6;
}

.project-card .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-bg);
    font-size: 0.9rem;
}

.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(108, 92, 231, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    margin-top: auto;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

social-icon:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .header-content,
    footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    footer {
        flex-direction: column-reverse;
    }
    
    .logo h1, .project-title {
        font-size: 1.5rem;
    }
}
