/**
 * Frontend styles for My Portfolio plugin with Dark/Light Mode
 */

/* ==============================================
   CSS VARIABLES & DEFAULTS
   ============================================== */

:root {
    --primary-color: #FF6B35;
    --secondary-color: #FFF8DC;
    --accent-color: #40E0D0;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #ffffff;
    --background-section: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #FF6B35;
    --secondary-color: #1a237e;
    --accent-color: #40E0D0;
    --text-dark: #e8eaed;
    --text-light: #bdc1c6;
    --background-light: #0d1117;
    --background-section: #161b22;
    --border-color: #30363d;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.5);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.7);
}

/* Force theme backgrounds with specific colors */
[data-theme="light"] .portfolio-about {
    background: #f8f9fa !important;
}

[data-theme="light"] .portfolio-projects {
    background: #f8f9fa !important;
}

[data-theme="light"] .services-section {
    background: #f8f9fa !important;
}

[data-theme="dark"] .portfolio-about {
    background: #161b22 !important;
}

[data-theme="dark"] .portfolio-projects {
    background: #161b22 !important;
}

[data-theme="dark"] .services-section {
    background: #161b22 !important;
}

[data-theme="dark"] .about-content,
[data-theme="dark"] .skills-section,
[data-theme="dark"] .services-grid {
    background: transparent !important;
}

/* Force dark theme backgrounds */
[data-theme="dark"] .portfolio-about,
[data-theme="dark"] .portfolio-projects,
[data-theme="dark"] .services-section {
    background: var(--background-section) !important;
}

[data-theme="dark"] .portfolio-hero {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--secondary-color) 100%) !important;
}

/* ==============================================
   THEME TOGGLE BUTTON
   ============================================== */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.theme-toggle-icon {
    font-size: 16px;
    transition: var(--transition);
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: inline;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: inline;
}

/* ==============================================
   GLOBAL STYLES
   ============================================== */

.my-portfolio-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--background-light);
    transition: var(--transition);
}

.my-portfolio-container * {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ==============================================
   BUTTONS
   ============================================== */

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 16px;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #FF8A65);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ==============================================
   HERO SECTION
   ============================================== */

.portfolio-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--background-light);
    overflow: hidden;
}

[data-theme="light"] .portfolio-hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #f0f8ff 100%) !important;
}

[data-theme="dark"] .portfolio-hero {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--secondary-color) 100%) !important;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

[data-theme="light"] .hero-background {
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(64, 224, 208, 0.1) 0%, transparent 50%);
}

[data-theme="dark"] .hero-background {
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(64, 224, 208, 0.2) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-image {
    text-align: center;
}

.profile-photo {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid var(--background-light);
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
}

.profile-photo:hover {
    transform: scale(1.05);
}

.hero-text {
    text-align: left;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.1;
}

.hero-title {
    font-size: 1rem !important;
    text-align:center !important;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-actions {
    display: none;
    gap: 20px;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ==============================================
   ABOUT SECTION
   ============================================== */

.portfolio-about {
    padding: 100px 0;
    background: var(--background-section);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 60px;
    text-align: center;
}

.skills-section {
    margin-bottom: 60px;
}

.skills-section h3 {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.skills-category h4 {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-bottom: 25px;
    text-align: center;
}

.skills-list {
    space: 20px 0;
}

.skill-item {
    margin-bottom: 25px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.skill-icon {
    font-size: 1.2rem;
}

.skill-percentage {
    font-weight: 700;
    color: var(--primary-color);
}

.skill-bar {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
    width: 0%;
    transition: width 1.5s ease-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==============================================
   SERVICES SECTION
   ============================================== */

.services-section {
    margin-top: 60px;
}

.services-section h3 {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-item {
    background: var(--background-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.service-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.service-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* ==============================================
   PORTFOLIO SECTION
   ============================================== */

.portfolio-projects {
    padding: 100px 0;
    background: var(--background-section);
}

.portfolio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 20px;
}

.portfolio-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--background-light);
    color: var(--text-dark);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.portfolio-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

#portfolio-search {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    transition: var(--transition);
    width: 100%;
    background: var(--background-light);
    color: var(--text-dark);
}

#portfolio-search:focus {
    border-color: var(--primary-color);
}

#search-btn {
    padding: 10px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#search-btn:hover {
    background: var(--accent-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.portfolio-item {
    transition: var(--transition);
}

.portfolio-item.hidden {
    display: none;
}

.project-card {
    background: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 107, 53, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-image:hover .project-overlay {
    opacity: 1;
}

.project-image:hover img {
    transform: scale(1.1);
}

.project-actions {
    display: flex;
    gap: 15px;
}

.btn-view-project,
.btn-external {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid white;
    color: white;
    background: transparent;
    cursor: pointer;
}

.btn-view-project:hover,
.btn-external:hover {
    background: white;
    color: var(--primary-color);
    text-decoration: none;
}

.project-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 15px;
}

.project-category {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: #e8f5e8; color: #2e7d32; }
.status-completed { background: #e3f2fd; color: #1565c0; }
.status-ongoing { background: #fff3e0; color: #ef6c00; }
.status-seeking-funding { background: #fce4ec; color: #c2185b; }

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.featured-badge {
    color: #ffc107;
    margin-left: 10px;
}

.project-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background: var(--background-section);
    color: var(--text-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tech-more {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.btn-details {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.btn-details:hover {
    color: var(--accent-color);
}

.project-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.portfolio-empty {
    text-align: center;
    padding: 80px 20px;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
}

/* ==============================================
   CONTACT SECTION
   ============================================== */

.portfolio-contact {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.portfolio-contact .section-title,
.portfolio-contact .section-subtitle {
    color: white;
}

.portfolio-contact .section-title::after {
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: white;
    text-align:center;
}

.contact-items {
    space: 25px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.contact-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.contact-details {
    flex: 1;
}

.contact-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.contact-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-form-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: white;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.contact-note {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 15px;
    text-align: center;
}

.social-section {
    text-align: center;
}

.social-section h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: white;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-5px);
    text-decoration: none;
}

/* ==============================================
   PORTFOLIO MODAL
   ============================================== */

.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--background-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.modal-header {
    position: relative;
    padding: 12px;
    background: var(--background-section);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

.modal-nav {
    display: flex;
    gap: 12px;
}

.modal-prev,
.modal-next {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-prev:hover,
.modal-next:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.modal-content {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    background: var(--background-light);
    color: var(--text-dark);
}

/* Project Modal Content Styles */
.modal-project-content {
    padding: 0;
}

.project-header {
    display: grid;
    gap: 32px;
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
}

.project-image {
    position: relative;
}

.project-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: var(--shadow-light);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.project-meta {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: center;
}

.project-category {
    background: var(--accent-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-date {
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

.project-content {
    padding: 32px;
}

.project-description {
    margin-bottom: 32px;
}

.project-description h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    font-weight: 600;
}

.project-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin: 0;
}

.project-technologies {
    margin-bottom: 32px;
}

.project-technologies h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    font-weight: 600;
}

.technologies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.technologies-list .tech-tag {
    background: var(--background-section);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.technologies-list .tech-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.project-gallery {
    margin-top: 32px;
}

.project-gallery h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Masonry Layout for Gallery */
@supports (grid-template-rows: masonry) {
    .gallery-grid {
        grid-template-rows: masonry;
        align-tracks: start;
    }
}

/* Fallback Masonry Effect */
.gallery-grid img:nth-child(3n+1) {
    grid-row-end: span 2;
}

.gallery-grid img:nth-child(3n+2) {
    grid-row-end: span 3;
}

.gallery-grid img:nth-child(3n+3) {
    grid-row-end: span 2;
}

.modal-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==============================================
   SMOOTH SCROLLING
   ============================================== */

.smooth-scroll {
    scroll-behavior: smooth;
}

/* ==============================================
   ANIMATIONS
   ============================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
        padding-bottom:50px;
    }
    
    .hero-name {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
        text-align:center;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .portfolio-filters {
        justify-content: center;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .social-links {
        gap: 15px;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .profile-photo {
        width: 250px;
        height: 250px;
        margin-top:20%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 40px;
    }
    
    .hero-name {
        font-size: 2rem;
        text-align:center;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .portfolio-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        text-align: center;
    }
    
    #portfolio-search {
        width: 100%;
    }
    
    .project-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-view-project,
    .btn-external {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .profile-photo {
        width: 200px;
        height: 200px;
        margin-top:30%;
    }
    
    .modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-arrow {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.filter-btn:focus,
#portfolio-search:focus,
.social-link:focus,
.modal-close:focus,
.modal-prev:focus,
.modal-next:focus,
.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 10px rgba(0,0,0,0.3);
        --shadow-hover: 0 8px 30px rgba(0,0,0,0.4);
        --border-color: #000000;
    }
    
    [data-theme="dark"] {
        --shadow-light: 0 2px 10px rgba(255,255,255,0.3);
        --shadow-hover: 0 8px 30px rgba(255,255,255,0.4);
        --border-color: #ffffff;
    }
    
    .project-card,
    .service-item,
    .contact-item {
        border: 2px solid var(--border-color);
    }
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #FF6B35;
        --secondary-color: #1a237e;
        --accent-color: #40E0D0;
        --text-dark: #e8eaed;
        --text-light: #bdc1c6;
        --background-light: #0d1117;
        --background-section: #161b22;
        --border-color: #30363d;
        --shadow-light: 0 2px 10px rgba(0,0,0,0.5);
        --shadow-hover: 0 8px 30px rgba(0,0,0,0.7);
    }
}