:root {
    --primary-color: #4a89dc;
    --secondary-color: #3d6bb3;
    --background-color: #f9f9f9;
    --text-color: #333;
    --card-bg: #fff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Dark theme */
.dark-theme {
    --primary-color: #64b5f6;
    --secondary-color: #42a5f5;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Switch for dark theme */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: var(--transition);
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: var(--transition);
    width: 16px;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-switch-wrapper em {
    margin-left: 10px;
    font-size: 0.9rem;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: var(--background-color);
    clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 100%);
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

social-links {
    margin-top: 20px;
}

.social-links a {
    display: inline-block;
    margin: 0 10px;
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-5px);
}

/* Sections */
section {
    padding: 60px 0;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60%;
    height: 3px;
    background-color: var(--primary-color);
    left: 50%;
    transform: translateX(-50%);
}

/* Filters */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    border-radius: 20px;
    padding: 8px 20px;
    margin: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.tech-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.project-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.project-description {
    margin-bottom: 15px;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
}

.tech-tag {
    background-color: rgba(74, 137, 220, 0.1);
    color: var(--primary-color);
    border-radius: 15px;
    padding: 3px 10px;
    margin: 2px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.project-links a {
    text-decoration: none;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.project-links a i {
    margin-right: 5px;
}

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

/* Loading spinner */
.loading {
    text-align: center;
    padding: 30px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

footer .fa-heart {
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}
