* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #22d3ee;
    --border-color: #334155;
}

/* Light Theme */
body.light-theme {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Toggle Buttons */
.toggle-buttons {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
}

.toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-image {
    margin-bottom: 1.5rem;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.social-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Sections */
section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
    border-bottom: none;
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* About */
.about p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
}

/* Gallery / Slideshow */
.gallery {
    text-align: center;
}

.slideshow {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.slides {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem 0.75rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.slide-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.slide-arrow.prev {
    left: 10px;
}

.slide-arrow.next {
    right: 10px;
}

.slide-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: var(--text-secondary);
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Projects */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--banner-url);
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 0.15;
}

.project-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.project-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.project-content {
    flex: 1;
    z-index: 1;
    min-width: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-card h3 {
    font-size: 1.25rem;
    margin: 0;
}

.download-count {
    font-size: 0.85rem;
    color: var(--accent-color);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    display: inline-block;
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

.project-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--accent-color);
}

/* Contact */
.contact {
    text-align: center;
}

.contact p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Contact Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    min-width: 320px;
    max-width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    transform: translateX(4px);
}

.contact-icon {
    font-size: 1.5rem;
    width: 2rem;
    text-align: center;
}

/* DM Form Styles */
.hidden {
    display: none !important;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--primary-color);
}

.dm-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

#char-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.submit-btn {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-status {
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.form-status.success {
    color: #22c55e;
}

.form-status.error {
    color: #ef4444;
}

#dm-form-view .modal-content,
#dm-form-view {
    width: 100%;
}

.modal-content:has(#dm-form-view:not(.hidden)) {
    min-width: 360px;
    max-width: 450px;
}

/* Cat Modal Styles */
.cat-modal-content {
    padding: 1rem;
    text-align: center;
    max-width: 500px;
}

.cat-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-btn {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
    
    section {
        padding: 2rem 0;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    .slideshow {
        border-radius: 12px;
    }
    
    .project-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
    }
    
    .project-icon {
        width: 64px;
        height: 64px;
    }
    
    .project-header {
        flex-direction: column;
        align-items: center;
    }
    
    .project-card h3 {
        font-size: 1.1rem;
    }
    
    .tech-tags {
        justify-content: center;
    }
    
    .contact-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .project-icon {
        width: 56px;
        height: 56px;
    }
    
    .tech-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}
