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

/* Light/Dark Theme Variables */
:root {
    /* Light Theme (Default) */
    --bg-color: #f5f5dc;
    --text-color: #333;
    --heading-color: #333;
    --primary-color: #8b4513;
    --primary-hover: #a0522d;
    --secondary-color: #e6e0c8;
    --card-bg: rgba(255, 255, 255, 0.5);
    --line-color: #ccc;
    --border-color: #8b4513;
    --notebook-binding: #8b4513;
    --clip-color: #d4d4d4;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --footer-bg: #e6e0c8;
    --footer-border: #8b4513;
    --line-pattern: rgba(204, 204, 204, 0.8); /* Increased opacity for better visibility */
    --paragraph-color: #555;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #2d2d2d;
    --text-color: #e0e0e0;
    --heading-color: #f0f0f0;
    --primary-color: #c87941;
    --primary-hover: #e89b59;
    --secondary-color: #3d3d3d;
    --card-bg: rgba(61, 61, 61, 0.7);
    --line-color: #555;
    --border-color: #c87941;
    --notebook-binding: #c87941;
    --clip-color: #888;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --footer-bg: #3d3d3d;
    --footer-border: #c87941;
    --line-pattern: rgba(100, 100, 100, 0.8); /* Brighter lines for dark mode */
    --paragraph-color: #cdcdcd; /* Lighter text for paragraphs in dark mode */
}

/* Theme Transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Lato', Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Theme Toggle Button - Moved to header */
.theme-toggle {
    position: relative; /* Changed from fixed */
    top: auto; /* Reset */
    right: auto; /* Reset */
    z-index: 10;
    background-color: var(--primary-color);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: background-color 0.3s, transform 0.3s;
    margin-left: 15px;
}

/* Header Styling - Simplified */
header {
    background-color: var(--secondary-color);
    padding: 10px 0;
    border-bottom: 3px solid var(--notebook-binding);
    box-shadow: 0 4px 8px var(--shadow-color);
    position: fixed;
    width: 100%;
    z-index: 1000;
    height: 60px;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo Styling */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 35px;
    margin-right: 10px;
}

.logo span {
    font-family: 'Indie Flower', cursive;
    font-weight: bold;
    font-size: 1.3em;
    color: var(--primary-color);
}

/* Adjust main content to accommodate header */
main {
    margin-top: 60px; /* Match header height */
    min-height: calc(100vh - 60px - 300px); /* Subtract header and approximate footer height */
    height: auto;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo span {
        font-size: 1.1em;
    }
    
    .theme-toggle {
        top: 70px; /* Move theme toggle below header on mobile */
    }
}

/* Enhanced Footer Responsiveness */
@media (max-width: 480px) {
    .footer-container {
        gap: 15px; /* Reduced from 25px */
        padding: 0 15px;
    }
    
    .footer-col {
        min-width: 100%;
        text-align: center;
        margin-bottom: 15px; /* Add space between columns */
        padding-bottom: 15px; /* Add padding for visual separation */
        border-bottom: 1px dashed var(--border-color); /* Add visual separator */
    }
    
    .footer-col:last-child {
        border-bottom: none; /* Remove border from last column */
        margin-bottom: 0; /* Remove bottom margin from last column */
        padding-bottom: 0; /* Remove bottom padding from last column */
    }
    
    .footer-col h4 {
        font-size: 1.1em;
        margin-bottom: 8px; /* Reduced from 10px */
    }
    
    /* Center the line under footer headings */
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 60px; /* Reduced from 80px */
    }
    
    /* Make footer links more compact */
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px; /* Reduced from 12px */
        margin-top: 5px;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
    
    .footer-links a {
        padding: 4px 6px; /* Reduced from 5px 8px */
        background-color: var(--card-bg);
        border-radius: 4px; /* Reduced from 5px */
        font-size: 0.9em;
    }
    
    /* Make contact info more compact */
    .footer-col .contact-info {
        margin-top: 5px;
    }
    
    .footer-col .contact-info p {
        justify-content: center;
        margin-bottom: 5px; /* Reduced from default */
    }
    
    /* Make social links more compact */
    .footer-col .social-links {
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 10px; /* Reduced from 20px */
    }
    
    .footer-col .social-links a {
        height: 30px; /* Reduced from 40px */
        width: 30px; /* Reduced from 40px */
        font-size: 1em; /* Reduced from 1.2em */
        margin: 0 5px;
    }
    
    .footer-bottom {
        padding: 10px 0; /* Reduced from 15px */
    }
    
    .footer-bottom p {
        font-size: 0.9em;
    }
}

/* Reduce footer padding in small screens */
@media (max-width: 768px) {
    footer {
        padding: 20px 0 0 0; /* Reduced from 30px */
    }
    
    .footer-bottom {
        margin-top: 15px; /* Reduced from 30px */
    }
    
    /* Remove extra space in social links */
    .footer-col .social-links {
        justify-content: center;
    }
}

/* Notebook Styling - Full screen */
.notebook {
    background-color: var(--bg-color);
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
    margin: 0;
    width: 100%;
    height: auto;
    min-height: auto;
    transition: none;
}

.notebook:hover {
    transform: none;
    box-shadow: none;
}

/* Notebook Binding - Enhanced */
.binding {
    background-color: var(--notebook-binding);
    height: 35px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 3px 6px var(--shadow-color);
}

/* Clips at the top - Enhanced */
.clip {
    width: 40px;
    height: 18px;
    background-color: var(--clip-color);
    border-radius: 3px;
    box-shadow: 0 2px 5px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.clip::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px 2px 0 0;
}

/* Notebook Tabs - Full width */
.notebook-tabs {
    display: flex;
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--line-color);
    padding: 0 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    height: 45px;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Indie Flower', cursive;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    height: 100%;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

/* Notebook Pages - Remove fixed height to avoid internal scrolling */
.notebook-pages {
    position: relative;
    min-height: auto;
    height: auto;
    overflow: visible;
    perspective: 1000px;
}

/* Fix notebook paper lines */
.page {
    display: none;
    position: relative;
    width: 100%;
    min-height: auto;
    background-color: var(--bg-color);
    background-image: linear-gradient(var(--line-pattern) 1px, transparent 1px);
    background-size: 100% 30px;
    background-attachment: local; /* Makes lines scroll with content */
    padding: 30px 40px;
    transform-origin: center;
    backface-visibility: hidden;
    will-change: opacity, transform;
}

/* Add line highlight effect */
.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(
        to right,
        rgba(255, 0, 0, 0.03) 0px,
        rgba(255, 0, 0, 0) 40px
    );
    pointer-events: none;
    z-index: 0;
}

.page-content {
    background-color: transparent; /* Changed from var(--bg-color) */
    position: relative;
    z-index: 1;
}

.page.active {
    display: block;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* NEW ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.page-title {
    font-family: 'Indie Flower', cursive;
    font-size: 2.2em;
    color: var(--heading-color);
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.line {
    height: 2px;
    background-color: var(--text-color);
    margin: 10px 0 30px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Section Subtitle Styling */
.section-subtitle {
    font-family: 'Indie Flower', cursive;
    font-size: 1.8em;
    color: var(--heading-color);
    margin-top: 40px;
    margin-bottom: 15px;
    text-align: left;
    position: relative;
    z-index: 2;
}

/* Add style for degree line to make it stand out */
.degree-highlight {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding: 8px 15px;
    background: var(--card-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    display: inline-block;
    box-shadow: 0 2px 5px var(--shadow-color);
}

/* Work Experience Styling */
.work-experience-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.work-item {
    display: flex;
    align-items: center;
    padding: 25px 0;
    border-bottom: 1px dashed var(--border-color);
}

.work-item:last-child {
    border-bottom: none;
}

.work-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
}

.work-details {
    flex: 1;
}

.work-details h3 {
    color: var(--heading-color);
    margin-bottom: 5px;
    font-size: 1.2em;
}

.company-name {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 8px;
}

.work-description {
    color: var(--paragraph-color);
    font-family: 'Lato', Arial, sans-serif;
    line-height: 1.5;
}

/* Responsive adjustments for work items */
@media (max-width: 768px) {
    .work-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
        padding: 20px 0;
    }
    
    .work-item img {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Hero Section Styling */
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
    min-width: 300px;
    padding-right: 30px;
}

.hero-text h1 {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: var(--heading-color);
    font-family: 'Indie Flower', cursive;
}

.hero-text .subheadline {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: var(--paragraph-color);
    font-family: 'Lato', Arial, sans-serif;
}

/* Button Container - Improve spacing */
.cta-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-cta {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-cta:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    background-color: transparent;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1em;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(139, 69, 19, 0.1);
    transform: translateY(-3px);
}

.btn-secondary i {
    margin-right: 8px;
}

/* Hero Image - Make it smaller */
.hero-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.hero-image img {
    max-width: 90%;
    max-height: 300px;
    height: auto;
    border-radius: 10px;
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
}

/* About Me Section */
.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.profile-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 1.1em;
    font-family: 'Lato', Arial, sans-serif;
    color: var(--paragraph-color);
}

.contact-info {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden; /* Prevent overflow */
    width: 100%; /* Ensure it takes full width */
}

.contact-info h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.contact-info i {
    margin-right: 10px;
    color: var(--primary-color);
    min-width: 20px;
    margin-right: 8px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--primary-color);
    font-size: 1.5em;
    transition: color 0.3s;
    margin: 5px;
}

.social-links a:hover {
    color: var(--primary-hover);
}

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

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-card h3 {
    padding: 15px 15px 5px;
    color: var(--heading-color);
}

.project-card p {
    padding: 0 15px 15px;
    color: var(--paragraph-color);
    font-family: 'Lato', Arial, sans-serif;
}

.project-links {
    position: absolute;
    top: 45px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.project-links a {
    text-align: center;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.demo-link {
    background-color: var(--primary-color);
    color: white;
}

.demo-link:hover {
    background-color: var(--primary-hover);
}

.code-link {
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.code-link:hover {
    background-color: var(--secondary-color);
}

/* Certifications Section */
.certifications-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.certification-item {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.certification-item:hover {
    transform: translateX(10px);
}

.cert-icon {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.cert-details h3 {
    color: var(--heading-color);
    margin-bottom: 5px;
}

.cert-issuer, .cert-date {
    color: var(--paragraph-color);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.cert-details p {
    font-family: 'Lato', Arial, sans-serif;
    color: var(--paragraph-color);
}

/* Hackathons Section */
.hackathons-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hackathon-item {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 30px;
}

.hackathon-item .project-links {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.hackathon-description {
    margin-bottom: 15px;
    line-height: 1.5;
    color: var(--paragraph-color);
}

.hackathon-image-container {
    width: 100%;
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.hackathon-image-container img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

/* Responsive fixes for hackathon items */
@media (max-width: 768px) {
    .hackathon-item {
        flex-direction: column;
        padding-bottom: 70px;
    }
    
    .hackathon-date {
        margin-bottom: 15px;
        margin-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 15px;
        padding-right: 0;
        align-items: center;
        text-align: center;
    }
    
    .hackathon-item .project-links {
        position: absolute;
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

.hackathon-date {
    min-width: 80px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-center: center;
    border-right: 2px solid var(--primary-color);
    padding-right: 20px;
    margin-right: 20px;
}

.hackathon-date .month {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.hackathon-date .year {
    font-size: 1em;
    color: var(--paragraph-color);
}

.hackathon-details h3 {
    color: var(--heading-color);
    margin-bottom: 5px;
}

.hackathon-organizer {
    color: var(--paragraph-color);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.hackathon-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.hackathon-tech span {
    background-color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    color: var(--primary-color);
}

.hackathon-details p {
    font-family: 'Lato', Arial, sans-serif;
    color: var(--paragraph-color);
}

/* Tech Stack Section */
.tech-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tech-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.tech-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.tech-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: 10px;
    transition: transform 0.3s;
}

.tech-icon:hover {
    transform: translateY(-5px);
}

.tech-icon i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.tech-icon span {
    font-size: 0.9em;
    color: var(--text-color);
    font-family: 'Lato', Arial, sans-serif;
}

/* Footer Styling - Updated for multi-column layout */
footer {
    background-color: var(--footer-bg);
    color: var(--text-color);
    border-top: 3px solid var(--footer-border);
    box-shadow: 0 -4px 8px var(--shadow-color);
    width: 100%;
    padding: 30px 0 0 0;
    margin-top: 30px; /* Add space between content and footer */
    position: relative; /* Ensure footer is in normal flow */
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding: 0 40px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.footer-col h4 {
    color: var(--primary-color);
    font-size: 1.2em;
    margin-bottom: 15px;
    font-family: 'Indie Flower', cursive;
    font-weight: bold;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 50px;
    background-color: var(--primary-color);
}

/* Footer Navigation Links */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--paragraph-color);
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
    font-family: 'Indie Flower', cursive;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Contact Information in Footer */
.footer-col .contact-info {
    margin-top: 0;
    padding: 0;
    background-color: transparent;
}

.footer-col .contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    word-break: break-word;
    font-size: 0.9em;
}

.footer-col .contact-info i {
    width: 20px;
    margin-right: 10px;
    color: var(--primary-color);
}

.btn-contact {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.btn-contact:hover {
    background-color: var(--primary-hover);
}

/* Social Links in Footer */
.footer-col .social-links {
    margin-bottom: 20px;
}

.footer-col .social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 35px;
    width: 35px;
    background-color: var(--card-bg);
    border-radius: 50%;
    color: var(--primary-color);
    margin-right: 10px;
    transition: all 0.3s;
}

.footer-col .social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

/* Newsletter Subscription */
.newsletter {
    margin-top: 20px;
}

.newsletter h4 {
    font-size: 1em;
    margin-bottom: 10px;
}

.subscribe-form {
    display: flex;
    height: 40px;
}

.subscribe-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    font-family: 'Lato', Arial, sans-serif;
    background-color: rgba(255, 255, 255, 0.8);
}

.subscribe-form button {
    padding: 0 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Lato', Arial, sans-serif;
}

.subscribe-form button:hover {
    background-color: var(--primary-hover);
}

/* Footer Bottom Section */
.footer-bottom {
    background-color: rgba(var(--primary-color), 0.1);
    padding: 15px 0;
    margin-top: 10px;
    text-align: center;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom p {
    margin: 0;
    font-size: 1em;
    color: #555;
    font-family: 'Indie Flower', cursive;
}

/* Fix back-to-top button width issues */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    width: 40px; /* Consistent size for all screens */
    height: 40px; /* Consistent size for all screens */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow-color);
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 999;
    text-decoration: none;
}

.back-to-top i {
    font-size: 1.2em;
}

/* Hide back-to-top by default when at top of page */
.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s, pointer-events 0s 0.2s;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-5px);
}

/* Mobile optimizations for back-to-top button */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px !important; /* Override any conflicting styles */
        height: 40px !important; /* Override any conflicting styles */
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* Add a subtle pulsing animation for better visibility */
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }
    
    .back-to-top:not(.hidden) {
        animation: pulse 2s infinite;
    }
    
    /* Specific active state for touch devices */
    .back-to-top:active {
        background-color: var(--primary-hover);
        transform: scale(0.95);
        opacity: 1;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
    }
}

/* Remove conflicting rule from footer bottom section */
@media (max-width: 768px) {
    .footer-bottom p {
        width: 100%;
    }
    /* Remove .back-to-top from this rule to avoid conflicts */
}

/* Enhanced Back to Top Button for Mobile */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow-color);
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 999; /* Increased z-index to ensure it's above everything */
}

/* Hide back-to-top by default when at top of page */
.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s, pointer-events 0s 0.2s;
}

/* Mobile optimizations for back-to-top button */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px; /* Larger touch target for mobile */
        height: 50px; /* Larger touch target for mobile */
        opacity: 0.85; /* Higher opacity for better visibility */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
    }
    
    .back-to-top i {
        font-size: 1.4em; /* Larger icon for better visibility */
    }
    
    /* Add a pulsing animation for better visibility */
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }
    
    .back-to-top:not(.hidden) {
        animation: pulse 2s infinite;
    }
    
    /* Specific active state for touch devices */
    .back-to-top:active {
        background-color: var(--primary-hover);
        transform: scale(0.95);
        opacity: 1;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

.back-to-top i {
    font-size: 1.2em;
}

/* Hide back-to-top by default when at top of page */
.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    
    .footer-col {
        min-width: 100%;
    }
    
    .footer-bottom .container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom p {
        width: 100%;
    }
    
    .footer-col .social-links {
        justify-content: flex-start;
    }
    
    /* Optimize nav bar for mobile */
    nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    nav a {
        font-size: 1em;
        padding: 8px 12px;
    }

    /* Optimize notebook tabs styling */
    .notebook-tabs {
        height: auto;
        padding: 5px 15px;
    }
    .tab-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    .tab-btn.active {
        background-color: rgba(var(--primary-color), 0.2);
    }
}

/* Responsive Design - Update for full screen */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
    }
    
    .hero-text, .hero-image {
        padding: 0;
        margin-bottom: 20px;
    }
    
    .notebook-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        height: 40px;
    }
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    .page {
        padding: 20px;
    }
    
    .about-content {
        flex-direction: column;
        align-items: center;
    }
    
    .certification-item, .hackathon-item {
        flex-direction: column;
        padding-bottom: 60px;
    }
    
    .cert-icon, .hackathon-date {
        margin-bottom: 15px;
        margin-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 15px;
        padding-right: 0;
    }

    .hackathon-item .project-links {
        justify-content: center;
        top: auto;
        bottom: 15px;
        right: 10px;
    }
    
    header {
        height: 50px;
    }
    
    main {
        margin-top: 50px;
        flex: 1;
        min-height: auto;
        height: auto;
    }
    
    .notebook {
        height: auto;
    }
    
    .notebook-pages {
        height: auto;
    }
    
    footer {
        height: auto;
    }
    
    .project-card .project-links,
    .hackathon-item .project-links {
        top: auto;
        bottom: 15px;
        right: 10px;
    }

    .project-card {
        padding-bottom: 60px;
    }
    
    .hackathons-list {
        padding-bottom: 40px;
    }
}

/* New responsive button styling for small screens */
@media (max-width: 480px) {
    .btn-cta,
    .btn-contact,
    .subscribe-form button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .project-links a {
        font-size: 0.8em;
        padding: 8px 10px;
        white-space: normal;
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 480px) {
    .notebook-tabs {
        height: auto;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tab-btn {
        padding: 5px 8px;
        font-size: 11px;
        margin: 2px;
        border-radius: 4px;
        background-color: rgba(139, 69, 19, 0.1);
    }
    
    .tab-btn.active {
        background-color: rgba(139, 69, 19, 0.3);
    }
    
    .page {
        padding: 15px 10px; /* Reduce horizontal padding */
    }
    
    .tech-icons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .tech-icon {
        padding: 8px;
    }
    
    .tech-icon i {
        font-size: 1.8em;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.7em;
    }
    
    .hero-text h1 {
        font-size: 2em;
    }
    
    .contact-info {
        padding: 10px;
    }
}

/* Fix notebook pages calculation for smaller screens with wrapped tabs */
@media (max-width: 480px) {
    .notebook-pages {
        min-height: calc(100% - 35px - auto);
        height: auto;
    }
    
    .hackathon-details img {
        height: auto;
        max-height: 120px;
    }
}

/* For PC view: position project-links at the bottom of .project-card */
@media (min-width: 769px) {
    .project-card .project-links {
        top: auto;
        bottom: 15px;
        right: 15px;
    }

    .project-card {
        padding-bottom: 70px;
    }
}
