/* ==========================================================================
   TABLE OF CONTENTS
   1. Base & Reusable Components
   2. Button Styles
   3. Section-Specific Styles
      - General Section Layouts
      - Hero Section
      - Skills Section
      - Experience Section
      - Projects & Blog Cards
      - Newsletter CTA Section (NEW)
      - Contact Section
   4. On-Scroll Animations
   5. Responsive Adjustments
   ========================================================================== */


/* ==========================================================================
   1. Base & Reusable Components
   ========================================================================== */
.portfolio-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.cards-container {
    gap: 30px; /* Override base gap for home page */
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

/* Home-specific section-title adjustments */
.section-title {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.section-title p {
    max-width: 800px;
}

/* Static cards - no hover movement but keep glow effect */
.contact-wrapper.card:hover,
.cta-container.card:hover {
    transform: none;
    box-shadow: 0 10px 25px var(--card-shadow);
    border-color: var(--card-border-hover);
}

/* ==========================================================================
   3. Section-Specific Styles
   ========================================================================== */

/* Home-specific portfolio header adjustments */
.portfolio-header { 
    text-align: left; 
    align-items: flex-start; 
}


/* Hero Section */
.home-container { display: flex; align-items: center; justify-content: space-between; gap: 40px; width: 100%; }
.home-content { display: flex; flex-direction: column; gap: 15px; max-width: 55%; z-index: 2; }
.home-content p:first-of-type { font-weight: 500; color: var(--title-color); }
.home-content p b { color: var(--title-color); }
.home-content h1 { line-height: 1; } /* Inherits from base.css h1 */
.home-content h1 span { color: var(--accent-color); font-weight: 600; }
.home-content h4 { font-weight: 400; } /* Inherits from base.css h4 */
.home-content h4 span { color: var(--accent-color); font-weight: 600; }

/* Hero Actions Buttons */
.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    align-items: center;
}

.hero-actions .filled-btn,
.hero-actions .outline-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Hero Bio Styling */
.hero-bio {
    margin-top: 15px;
    margin-bottom: 15px;
}

.hero-bio p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--paragraph-color);
    opacity: 0.9;
    max-width: 500px;
}

/* Hero Bio Text Styling */
.hero-bio p em {
    font-style: italic;
}

.hero-bio p b {
    font-weight: 600;
    color: var(--title-color);
}

.hero-bio p b span {
    color: var(--title-color);
    font-weight: 700;
}

#skill-text::after { content: '|'; margin-left: 5px; color: var(--accent-color); animation: blink 0.7s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.home-hero-image { max-width: 45%; position: relative; display: flex; align-items: center; justify-content: center; }
.home-hero-image::before { 
    content: ''; 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    background: radial-gradient(circle, var(--accent-color) 0%, rgba(0, 169, 255, 0.4) 30%, transparent 70%); 
    filter: blur(60px); 
    opacity: 0.4; 
    z-index: 0; 
    animation: pulse-glow 4s ease-in-out infinite; 
}

@keyframes pulse-glow { 
    0%, 100% { 
        transform: scale(0.95); 
        opacity: 0.3; 
    } 
    50% { 
        transform: scale(1.1); 
        opacity: 0.6; 
    } 
}

/* Second glow layer for more intensity */
.home-hero-image::after { 
    content: ''; 
    position: absolute; 
    width: 80%; 
    height: 80%; 
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 50%); 
    filter: blur(40px); 
    opacity: 0.3; 
    z-index: 0; 
    animation: pulse-glow-inner 3s ease-in-out infinite reverse; 
}

@keyframes pulse-glow-inner { 
    0%, 100% { 
        transform: scale(0.9); 
        opacity: 0.2; 
    } 
    50% { 
        transform: scale(1.05); 
        opacity: 0.4; 
    } 
}

.home-hero-image img { max-width: 80%; position: relative; z-index: 1; filter: saturate(1) brightness(1.1); }
.hero-stat-card { width: fit-content; position: absolute; display: flex; align-items: center; gap: 15px; padding: 15px; border-radius: 15px; background-color: rgba(1, 4, 9, 0.6); backdrop-filter: blur(10px); z-index: 3; }
.hero-stat-card .stat-icon { font-size: 20px; color: var(--accent-color); background-color: rgba(0, 169, 255, 0.1); padding: 10px; border-radius: 10px; }
.hero-stat-card .stat-text .stat-number { font-size: 20px; color: var(--title-color); font-family: var(--heading-font); line-height: 1; }
.hero-stat-card .stat-text .stat-label { font-size: 13px; color: var(--paragraph-color); }

/* Light theme stat cards */
[data-theme="light"] .hero-stat-card {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

/* Light theme stat icons */
[data-theme="light"] .hero-stat-card .stat-icon {
    background-color: rgba(0, 169, 255, 0.15);
}
.stat-1 { top: 30%; right: 0%; }
.stat-2 { bottom: 0%; right: 25%; }
.stat-3 { top: 45%; left: 0%; }

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    width: 100%;
    transition: all 0.3s ease;
}

.skills-grid:hover {
    box-shadow: 0 10px 25px var(--card-shadow);
    border-color: var(--accent-color);
}

.skill-category-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Removed hover effects from skill cards */

.skill-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.skill-category-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 169, 255, 0.1);
    border-radius: 12px;
    font-size: 24px;
    color: var(--accent-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.skill-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--title-color);
    margin: 0;
}

.skill-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 169, 255, 0.08);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag i {
    font-size: 12px;
    color: var(--accent-color);
}

.skill-category-card:hover .tech-tag {
    background: rgba(0, 169, 255, 0.15);
    transform: translateY(-2px);
}

.skill-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
}

.skills-count {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 600;
}

/* Light theme adjustments */
[data-theme="light"] .skill-category-icon {
    background-color: rgba(0, 169, 255, 0.15);
}

[data-theme="light"] .tech-tag {
    background: rgba(0, 169, 255, 0.1);
}

[data-theme="light"] .skill-category-card:hover .tech-tag {
    background: rgba(0, 169, 255, 0.2);
}


/* Experience Section */
.experience-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 20px;
    width: 100%;
}
.exp-card { 
    display: flex; 
    align-items: center;
    width: 100%;
    gap: 25px; 
    padding: 25px; 
    transition: all 0.3s ease; 
    color: inherit; 
    text-decoration: none;
}
.exp-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent-color); 
    box-shadow: 0 8px 25px rgba(0, 169, 255, 0.15);
}
.exp-img { flex-shrink: 0; }
.exp-img img { width: 60px; height: 60px; border-radius: 10px; border: 2px solid var(--card-border); }
.exp-details { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.exp-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.exp-header h3 {
    color: var(--title-color);
    font-size: 20px;
    line-height: 1.2;
}
.exp-header span { font-size: 14px; color: var(--paragraph-color); font-family: var(--code-font); background-color: var(--card-bg); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--card-border); }

/* Projects & Blog Cards */
.project-card, .blog-card { display: flex; flex-direction: column; gap: 15px; height: 100%; }

/* Project Media (YouTube Videos and Images) */
.project-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--card-background);
}

.project-media .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: 10px;
}

.project-media .project-image.placeholder {
    background-color: var(--card-border);
}

.youtube-video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.youtube-video-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Blog Images */
.blog-image { display: block; overflow: hidden; border-radius: 10px; }
.blog-image img { border-radius: 10px; width: 100%; height: 200px; object-fit: cover; transition: transform 0.4s ease; }
/* Removed hover transform for simplified styling */
.project-content, .blog-content { display: flex; flex-direction: column; gap: 15px; flex-grow: 1; }
.blog-content h4,
.project-content h3 {
    font-size: 22px;
    color: var(--title-color);
    line-height: 1.2;
}
.blog-content h4 a, .project-content h3 a { color: inherit; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.project-links { margin-top: auto; padding-top: 10px; display: flex; gap: 15px; flex-wrap: wrap; }
.blog-card { cursor: pointer; }
.blog-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--card-border); }
.publisher { display: flex; align-items: center; gap: 10px; }
.publisher img { width: 30px; height: 30px; border-radius: 50%; }
.blog-date { font-size: 14px; color: var(--paragraph-color); }

/* NEW: Newsletter CTA Section */
.cta-container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 40px; }
.cta-left-content { max-width: 40%; width: 100%; }
.cta-left-content i { font-size: 40px; color: var(--accent-color); }
.cta-left-content h2 { font-size: 36px; } /* Inherits from base.css h2 */
.cta-left-content h2 span { color: var(--accent-color); }
.cta-right-content { flex: 1; display: flex; justify-content: flex-end; }
.cta-form { display: flex; gap: 10px; width: 100%; }
.cta-form input { 
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 8px; 
    border: 1px solid var(--card-border); 
    background-color: var(--card-bg); 
    color: var(--title-color); 
    font-size: 16px; 
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.cta-form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 169, 255, 0.2);
}
.cta-form input::placeholder { color: var(--paragraph-color); opacity: 0.8; }
.cta-form .filled-btn { flex-shrink: 0; }
.newsletter-messages .message { padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; font-weight: 500; }
.newsletter-messages .success { background-color: rgba(0, 169, 255, 0.1); border: 1px solid var(--accent-color); color: var(--accent-color); }
.newsletter-messages .error { background-color: rgba(255, 82, 82, 0.1); border: 1px solid #ff5252; color: #ff5252; }
.newsletter-messages .info { background-color: rgba(255, 180, 0, 0.1); border: 1px solid #ffb400; color: #ffb400; }

/* Contact Section */
.contact-wrapper { 
    padding: 0; 
    overflow: hidden; 
    margin: 0 20px; /* Add horizontal margin for spacing from edges */
}
.contact-section .mail-contact-card { display: grid; grid-template-columns: 40% 1fr; }
.left-contact-info { background-color: var(--bg-gradient-start); padding: 40px; display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; z-index: 1; }
.left-contact-info::after { content: ''; position: absolute; width: 200px; height: 200px; background-color: rgba(0, 169, 255, 0.05); border-radius: 50%; bottom: -80px; right: -60px; z-index: -1; }
.left-contact-info h3 { font-family: var(--special-heading-font); font-size: 28px; color: var(--title-color); }
.left-contact-info p { line-height: 1.7; }
.contact-details-list { list-style: none; padding: 0; margin-top: auto; display: flex; flex-direction: column; gap: 20px; }
.contact-details-list li { display: flex; align-items: center; gap: 15px; font-size: 16px; }
.contact-details-list i { color: var(--accent-color); font-size: 18px; width: 20px; text-align: center; }
.right-contact-form { padding: 40px; }
.right-contact-form form { display: flex; flex-direction: column; gap: 30px; }
.form-group-row { display: flex; gap: 30px; }
.form-group { flex-grow: 1; width: 100%; }
.right-contact-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.right-contact-form input, .right-contact-form textarea { width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 12px 16px; font-size: 16px; color: var(--title-color); transition: border-color 0.3s ease; }
.right-contact-form textarea { resize: vertical; }
.right-contact-form input:focus, .right-contact-form textarea:focus { outline: none; border-color: var(--accent-color); }

/* Urgent Toggle Styles */
.urgent-toggle-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--card-border); }
.urgent-toggle-wrapper { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--card-border); transition: 0.3s; border-radius: 24px; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
input:checked + .toggle-slider { background-color: #ff6b35; }
input:checked + .toggle-slider:before { transform: translateX(26px); }
.toggle-label { display: flex; align-items: center; gap: 8px; }
.toggle-text { font-size: 14px; font-weight: 500; color: var(--title-color); }
.urgent-icon { color: #ff6b35; font-size: 16px; }
.urgent-warning { background: rgba(255, 107, 53, 0.1); border: 1px solid rgba(255, 107, 53, 0.3); border-radius: 8px; padding: 12px; display: none; }
.urgent-warning.show { display: block; }
.urgent-warning p { margin: 0; font-size: 13px; color: #ff6b35; display: flex; align-items: flex-start; gap: 8px; }
.urgent-warning i { margin-top: 2px; flex-shrink: 0; }

/* ==========================================================================
   4. On-Scroll Animations
   ========================================================================== */


/* ==========================================================================
   5. Responsive Adjustments
   ========================================================================== */
@media (max-width: 1000px) {
    .cards-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .home-container { flex-direction: column; text-align: center; }
    .home-content { max-width: 100%; align-items: center; order: 2; }
    .home-hero-image { order: 1; max-width: 60%; margin-bottom: 20px; }
    .portfolio-header { align-items: center; text-align: center; }

    .cta-container { flex-direction: column; text-align: center; }
    .cta-left-content { max-width: 100%; }
    .cta-right-content { justify-content: center; }
    .cta-form { width: 100%; }
    .contact-section .mail-contact-card { grid-template-columns: 1fr; }
    .contact-wrapper { margin: 0 15px; } /* Reduce margin on tablet */
    .left-contact-info { border-radius: 16px 16px 0 0; }
    .right-contact-form { border-radius: 0 0 16px 16px; }
}

@media (max-width: 768px) {
    .main-container { gap: 60px; } /* Reduced spacing */
    .cards-container { grid-template-columns: 1fr; }
    .home-hero-image { max-width: 80%; }
    .stat-1 { top: 30%; right: -5%; }
    .stat-2 { bottom: -5%; right: 15%; }
    .stat-3 { top: 40%; left: 5%; }
}

@media (max-width: 600px) {
    .hero-section { margin-top: 60px; } /* Reduced top margin */
    .main-container { gap: 40px; } /* Reduced gap significantly */
    .section-title { margin-bottom: 15px; }
    .home-content { gap: 10px; } /* Reduce gap between content elements */
    
    /* Hero Bio Responsive */
    .hero-bio { margin-top: 8px; margin-bottom: 8px; } /* Reduce bio margins */
    .hero-bio p {  font-size: 15px; max-width: 100%; text-align: center; }
    
    /* Hero Actions - Keep side by side until really tight */
    .hero-actions {
        justify-content: center;
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .hero-actions .filled-btn,
    .hero-actions .outline-btn {
        padding: 8px 12px;
        font-size: 14px;
        flex-shrink: 0;
    }
    
    .home-hero-image { max-width: 90%; }
    .hero-stat-card { padding: 8px; gap: 6px; }
    .home-hero-image .card { padding: 10px; }
    .hero-stat-card .stat-icon { font-size: 16px; padding: 5px; border-radius: 5px; }
    .hero-stat-card .stat-text .stat-number { font-size: 14px; }
    .hero-stat-card .stat-text .stat-label { font-size: 10px; }
    .stat-1 { top: 30%; right: -5%; }
    .stat-2 { bottom: 0%; right: 20%; }
    .stat-3 { top: 40%; left: -5%; }
    .skills-grid { grid-template-columns: 1fr; }
    .exp-card { flex-direction: column; text-align: center; gap: 15px; }
    .exp-header { flex-direction: column; gap: 5px; }
    .exp-card .skills { justify-content: center; }
    .cta-form { flex-direction: column; width: 100%; }
    .cta-form input { width: 100%; }
    .cta-form .filled-btn { width: 100%; text-align: center; }
    /* CTA container h2 inherits from base.css responsive h2 styles */
    .form-group-row { flex-direction: column; gap: 20px; }
    .contact-wrapper { margin: 0 10px; } /* Further reduce margin on mobile */
    .left-contact-info, .right-contact-form { padding: 20px; }
    .card, .cta-container { padding: 15px; }
    .contact-wrapper { padding: 0 !important; }
    .outline-btn[type="submit"] { width: 100%; text-align: center; display: block; padding: 12px; }
    .urgent-toggle-wrapper { flex-direction: column; align-items: flex-start; gap: 8px; }
    .urgent-warning p { font-size: 12px; }
}

/* Very small screens - only stack buttons if absolutely necessary */
@media (max-width: 350px) {
    .hero-actions {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .hero-actions .filled-btn,
    .hero-actions .outline-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}