/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.profile-container {
    flex-shrink: 0;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    position: relative;
}

.profile-pic:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Main Content */
main {
    padding: 3rem 2rem;
}

/* Bio Section */
.bio {
    flex: 1;
    text-align: left;
}

.bio p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Portfolio Grid */
.portfolio-grid {
    max-width: 1000px;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab {
    padding: 0.875rem 2rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tab.active:hover {
    background: var(--primary-dark);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Portfolio Items */
.portfolio-item {
    display: flex;
    margin-bottom: 2.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover::before {
    opacity: 1;
}

.item-media {
    flex: 1 1 300px;
    min-height: 250px;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-media:hover img {
    transform: scale(1.05);
}

.item-media iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.item-info {
    flex: 2 1 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.item-info p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Markdown formatting in descriptions */
.item-info p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.item-info p em {
    font-style: italic;
}

.item-info p a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.item-info p a:hover {
    border-bottom-color: var(--primary-color);
}

.item-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.item-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.item-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Read More Button */
.read-more-btn {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.read-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Blog specific styling */
#blogs .portfolio-item {
    flex-direction: row-reverse; /* Image on right, content on left */
}

#blogs .item-media {
    flex: 1 1 250px; /* Smaller image area for blogs */
    min-height: 200px;
}

#blogs .item-info {
    flex: 2 1 350px; /* Larger content area for blogs */
    padding: 2rem;
}

#blogs .item-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

#blogs .item-media img {
    object-fit: cover;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .container {
        border-radius: var(--radius-xl);
        margin: 0;
    }
    
    header {
        padding: 2rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .bio {
        text-align: center;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
    }
    
    .social-icons {
        gap: 1rem;
    }
    
    .social-icons a {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    .bio p {
        font-size: 1.125rem;
    }
    
    .tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .portfolio-item {
        flex-direction: column;
        margin-bottom: 2rem;
    }
    
    /* Override blog layout on mobile */
    #blogs .portfolio-item {
        flex-direction: column;
    }
    
    .item-media {
        min-height: 200px;
    }
    
    .item-info {
        padding: 1.5rem;
    }
    
    .item-info h3 {
        font-size: 1.25rem;
    }
    
    .item-links {
        gap: 0.75rem;
    }
    
    .item-links a {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        gap: 1.5rem;
    }
    
    .profile-pic {
        width: 120px;
        height: 120px;
    }
    
    .social-icons a {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .bio p {
        font-size: 1rem;
    }
    
    .item-info {
        padding: 1.25rem;
    }
    
    .item-info h3 {
        font-size: 1.125rem;
    }
    
    .tabs {
        margin: 0 -0.5rem 2rem;
        border-radius: var(--radius-lg);
    }
}

/* Smooth scrolling and focus styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading animation for images */
.item-media img {
    opacity: 0;
    animation: imageLoad 0.5s ease-in-out forwards;
}

@keyframes imageLoad {
    to {
        opacity: 1;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */


@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    header {
        background: white !important;
        color: black !important;
    }
    
    .social-icons {
        display: none;
    }
}