/* =========================================================
    MOBILE-FIRST RESPONSIVE PORTFOLIO STYLESHEET
    Enhanced visual layout with improved mobile support
========================================================= */

/* Global reset and base document setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #f2f2f2;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    letter-spacing: 0.5px;
    transition: background 0.6s ease, color 0.6s ease;
    background: radial-gradient(circle at 30% 15%, rgba(110, 177, 255, 0.22) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(88, 212, 255, 0.17) 0%, transparent 45%),
                linear-gradient(135deg, #151e3c 0%, #0e1c3a 50%, #0b1325 100%);
    background-attachment: fixed;
    font-size: 1rem;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ===== LIGHT MODE ===== */
body.light-mode {
    background: radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.65) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(165, 205, 255, 0.45) 0%, transparent 50%),
                linear-gradient(135deg, #d3d8ea 0%, #e7eff8 55%, #dbe2ec 100%);
    color: #1a1a1a;
}

/* ===== HEADER & NAVIGATION ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: rgba(32, 54, 64, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 173, 181, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: clamp(1.2rem, 4vw, 2rem);
    animation: gradientShift 3s ease-in-out infinite;
    background: linear-gradient(90deg, #00ffd9, #00adb5, #00ffd9);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    margin: 0;
}

body.light-mode header h1 {
    background: linear-gradient(90deg, #1a1a1a, #333333, #1a1a1a);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode header {
    background-color: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e0e0e0;
}

body {
    padding-top: 70px;
}

@media (max-width: 768px) {
    header {
        position: fixed;
        padding: 12px 15px;
        justify-content: space-between;
    }

    body {
        padding-top: 68px;
    }

    .header-right {
        gap: 10px;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Menu button */
#menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #00ffd9;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.3s ease;
}

#menu-btn:hover {
    transform: scale(1.1);
}

#menu-btn.active {
    color: #00adb5;
}

body.light-mode #menu-btn {
    color: #0097a7;
}

/* Navigation Menu */
nav {
    position: static;
    margin-left: auto;
    background: none;
    box-shadow: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: #00ffd9;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 173, 181, 0.3);
    box-shadow: 0 2px 8px rgba(0, 173, 181, 0.1);
}

nav a:hover,
nav a.active {
    background: linear-gradient(90deg, #00adb5 0%, #00ffd9 100%);
    color: #222;
    border-color: #00ffd9;
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.25);
    transform: translateY(-2px);
}

body.light-mode nav a {
    color: #0097a7;
    border-color: rgba(0, 150, 167, 0.3);
}

body.light-mode nav a:hover,
body.light-mode nav a.active {
    background: linear-gradient(90deg, #b2ebf2 0%, #e0f7fa 100%);
    color: #006a73;
    border-color: #00adb5;
}

#theme-toggle {
    background-color: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 173, 181, 0.3);
    margin: 0;
    line-height: 1;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: rgba(0, 173, 181, 0.2);
    border-color: #00adb5;
}

.toggle-item {
    display: flex;
    align-items: center;
}

/* Mobile Menu */
@media (max-width: 768px) {
    #menu-btn {
        display: block;
    }

    #nav-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 10px;
        right: 10px;
        background: rgba(32, 54, 64, 0.98);
        backdrop-filter: blur(10px);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease;
        border: 1px solid rgba(0, 173, 181, 0.2);
        border-radius: 14px;
        opacity: 0;
    }

    #nav-menu.active {
        max-height: 420px;
        display: block;
        opacity: 1;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 12px 14px;
        align-items: stretch;
    }

    nav a {
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid rgba(0, 173, 181, 0.2);
        box-shadow: none;
        border-radius: 0;
        font-size: 0.95rem;
    }

    nav a:hover,
    nav a.active {
        background: transparent;
        border-bottom: 2px solid #00adb5;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateX(4px);
    }

    body.light-mode #nav-menu {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -999px;
    left: -999px;
    background: #00adb5;
    color: #fff;
    padding: 8px 12px;
    z-index: 2000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 20px;
    left: 20px;
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

main > section {
    margin-top: 20px;
}

section {
    margin-bottom: 60px;
    padding-bottom: 30px;
    position: relative;
}

@media (max-width: 640px) {
    main {
        padding: 16px 14px;
    }

    main > section {
        margin-top: 12px;
    }

    section {
        margin-bottom: 40px;
        padding-bottom: 16px;
    }
}

/* ===== HEADINGS & TEXT ===== */
h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 25px;
    color: #00ffd9;
}

body.light-mode h2 {
    color: #006a73;
}

h3 {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 15px;
    color: #00ffd9;
}

body.light-mode h3 {
    color: #006a73;
}

p {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: #d9d9d9;
    line-height: 1.7;
    margin-bottom: 15px;
}

body.light-mode p {
    color: #333;
}

ul, ol {
    padding-left: 20px;
}

ul li, ol li {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-bottom: 12px;
    color: #d9d9d9;
    line-height: 1.6;
}

body.light-mode ul li,
body.light-mode ol li {
    color: #333;
}

/* ===== CARD STYLES ===== */
.home-card, .about-card, .projects-card, .api-card, .profile-card, .info-card {
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.15) 0%, rgba(34, 40, 49, 0.85) 100%);
    border: 2px solid #00adb5;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 173, 181, 0.15);
    color: #e0f7fa;
    padding: 30px;
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .home-card, .about-card, .projects-card, .api-card, .profile-card, .info-card {
        padding: 20px 16px;
        border-radius: 14px;
    }
}

.home-card:hover, .about-card:hover, .projects-card:hover, .api-card:hover, .profile-card:hover, .info-card:hover {
    box-shadow: 0 12px 32px rgba(0, 173, 181, 0.25);
    border-color: #00ffd9;
}

body.light-mode .home-card,
body.light-mode .about-card,
body.light-mode .projects-card,
body.light-mode .api-card,
body.light-mode .profile-card,
body.light-mode .info-card {
    background: linear-gradient(135deg, #e7eff8 0%, #d3f6f9 100%);
    border-color: #00adb5;
    box-shadow: 0 6px 20px rgba(0, 173, 181, 0.1);
    color: #222;
}

body.light-mode .home-card:hover,
body.light-mode .about-card:hover,
body.light-mode .projects-card:hover,
body.light-mode .api-card:hover,
body.light-mode .profile-card:hover,
body.light-mode .info-card:hover {
    border-color: #00ffd9;
    box-shadow: 0 12px 28px rgba(0, 173, 181, 0.2);
}

/* ===== HERO SECTION ===== */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 420px);
    gap: clamp(28px, 4vw, 50px);
    align-items: center;
    margin: 60px auto 80px;
    padding: 0;
}

.hero-text {
    padding: clamp(20px, 3vw, 30px);
}

.hero-image {
    display: grid;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.hero-image img {
    width: min(100%, 420px);
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 173, 181, 0.3);
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        margin: 40px auto 60px;
    }

    .hero-text h2 {
        font-size: 2.2rem;
    }

    .hero-image img {
        max-width: 320px;
    }
}

@media (max-width: 640px) {
    .hero {
        gap: 24px;
        margin: 24px auto 40px;
        padding: 0 2px;
    }

    .hero-text {
        padding: 20px 16px;
    }

    .hero-text h2 {
        font-size: 1.8rem;
        margin-bottom: 18px;
    }

    .hero-text .intro,
    .hero-text .description {
        max-width: none;
        font-size: 0.98rem;
    }

    .hero-image {
        width: 100%;
    }

    .hero-image img {
        width: min(100%, 320px);
        max-width: 320px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }

    .cta-button.secondary-btn {
        margin-left: 0;
    }
}

.hero-text h2 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    line-height: 1.2;
    margin-bottom: 25px;
    font-weight: 800;
    background: linear-gradient(90deg, #00ffd9, #00adb5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInLeft 0.7s ease-out;
}

.hero-text .intro,
.hero-text .description {
    max-width: 65ch;
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: 20px;
    color: #fffcfc;
}

body.light-mode .hero-text .intro,
body.light-mode .hero-text .description {
    color: #1a1a1a;
}

.hero-image {
    display: grid;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.hero-image img {
    width: min(100%, 420px);
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 173, 181, 0.3);
}

.hero-image::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 350px;
    background: rgba(0, 173, 181, 0.2);
    filter: blur(100px);
    z-index: -1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        margin: 40px auto 60px;
    }

    .hero-text h2 {
        font-size: 2.2rem;
    }

    .hero-image img {
        max-width: 320px;
    }
}

@media (max-width: 640px) {
    .hero {
        gap: 24px;
        margin: 24px auto 40px;
        padding: 0 2px;
    }

    .hero-text {
        padding: 20px 16px;
    }

    .hero-text h2 {
        font-size: 1.8rem;
    }

    .hero-image img {
        width: min(100%, 320px);
        max-width: 320px;
    }

    .hero-image::before {
        width: 220px;
        height: 220px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }

    .cta-button.secondary-btn {
        margin-left: 0;
    }
}

/* ===== CTA CARDS ===== */
.cta-section {
    margin: 60px 0 40px;
    padding: 40px 25px;
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.08) 0%, rgba(34, 40, 49, 0.4) 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 173, 181, 0.2);
}

.cta-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}

.cta-card {
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.12) 0%, rgba(34, 40, 49, 0.75) 100%);
    border: 2px solid #00adb5;
    border-radius: 14px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.cta-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 173, 181, 0.3);
    border-color: #00ffd9;
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.2) 0%, rgba(34, 40, 49, 0.9) 100%);
}

.cta-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #00ffd9;
}

.cta-card p {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(90deg, #00adb5 0%, #00ffd9 100%);
    color: #222;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.cta-button:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 173, 181, 0.4);
}

.cta-button.secondary-btn {
    background: transparent;
    border: 2px solid #00adb5;
    color: #00ffd9;
    margin-left: 12px;
}

.cta-button.secondary-btn:hover {
    background: rgba(0, 173, 181, 0.2);
    border-color: #00ffd9;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

body.light-mode .cta-card {
    background: linear-gradient(135deg, #e7eff8 0%, #d3f6f9 100%);
    border-color: #00adb5;
}

body.light-mode .cta-card:hover {
    border-color: #00ffd9;
}

body.light-mode .cta-card h3 {
    color: #006a73;
}

body.light-mode .cta-card p {
    color: #333;
}

body.light-mode .cta-button.secondary-btn {
    border-color: #0097a7;
    color: #006a73;
}

body.light-mode .cta-button.secondary-btn:hover {
    background: rgba(0, 150, 167, 0.15);
    border-color: #00adb5;
    color: #005a66;
}

@media (max-width: 640px) {
    .cta-section {
        padding: 30px 20px;
    }

    .cta-section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .cta-grid {
        grid-template-columns: 1fr;
    }

    .cta-card {
        padding: 25px 20px;
    }

    .cta-card h3 {
        font-size: 1.1rem;
    }

    .cta-card p {
        font-size: 0.9rem;
    }

    .cta-button {
        padding: 10px 22px;
        font-size: 0.95rem;
    }
}

/* ===== INFO GRID (ABOUT PAGE) ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.info-card {
    padding: 25px !important;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.info-card h3 {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    color: #00ffd9;
}

body.light-mode .info-card h3 {
    color: #006a73;
}

.info-card p,
.info-card ul,
.info-card li {
    color: #d9d9d9;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

body.light-mode .info-card p,
body.light-mode .info-card ul,
body.light-mode .info-card li {
    color: #333;
}

/* Skill bars */
.skill-bar {
    margin: 15px 0;
}

.skill-bar label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #00ffd9;
}

body.light-mode .skill-bar label {
    color: #006a73;
}

.skill-bar .bar {
    height: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.skill-bar .completed {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #00adb5, #66f3ff);
    border-radius: 8px;
    transition: width 1.2s ease;
}

@media (max-width: 1000px) {
    .info-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        min-height: auto;
        padding: 20px !important;
    }
}

/* ===== PROJECT FILTER ===== */
.project-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.project-filter button {
    background: rgba(0, 173, 181, 0.15);
    border: 2px solid rgba(0, 173, 181, 0.4);
    color: #00ffd9;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.project-filter button:hover {
    background: rgba(0, 173, 181, 0.3);
    border-color: #00ffd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.2);
}

.project-filter button.active {
    background: linear-gradient(90deg, #00adb5, #00ffd9);
    color: #222;
    border-color: #00ffd9;
    box-shadow: 0 6px 16px rgba(0, 173, 181, 0.3);
}

body.light-mode .project-filter button {
    background: rgba(0, 150, 167, 0.1);
    border-color: rgba(0, 150, 167, 0.3);
    color: #006a73;
}

body.light-mode .project-filter button:hover {
    background: rgba(0, 150, 167, 0.2);
    border-color: #00adb5;
}

body.light-mode .project-filter button.active {
    background: linear-gradient(90deg, #00adb5, #4dd0e1);
    color: white;
    border-color: #00adb5;
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.2);
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.project-card {
    background: rgba(214, 37, 37, 0.04);
    border: 1px solid rgba(0, 173, 181, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 173, 181, 0.2);
    border-color: #00adb5;
    background: rgba(255, 255, 255, 0.08);
}

.project-title {
    color: #00ffd9;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-title::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.project-title.expanded::after {
    transform: rotate(180deg);
}

.project-details {
    display: none;
    margin-top: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.project-details.active {
    display: block;
    max-height: 1500px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tech-tag {
    background: linear-gradient(90deg, #00adb5, #66f3ff);
    color: #222;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.screenshot {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.2);
    border: 1px solid rgba(0, 173, 181, 0.3);
    transition: all 0.3s ease;
}

.screenshot:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 173, 181, 0.3);
}

body.light-mode .project-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .project-title {
    color: #006a73;
}


@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CONTACT FORM ===== */
#contact-form {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

#contact-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #00ffd9;
}

body.light-mode #contact-form label {
    color: #006a73;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid rgba(0, 173, 181, 0.3);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #00adb5;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 12px rgba(0, 173, 181, 0.3);
    outline: none;
}

#contact-form button {
    background: linear-gradient(90deg, #00adb5, #00ffd9);
    color: #222;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-top: 10px;
}

#contact-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 173, 181, 0.3);
}

#contact-feedback {
    min-height: 20px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 10px;
}

#contact-feedback.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border-left: 3px solid #4caf50;
}

#contact-feedback.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border-left: 3px solid #f44336;
}

body.light-mode #contact-form input,
body.light-mode #contact-form textarea {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 173, 181, 0.4);
    color: #111;
}

body.light-mode .cta-button {
    background: linear-gradient(90deg, #0097a7 0%, #00adb5 100%);
    color: white;
}

body.light-mode .cta-button:hover {
    box-shadow: 0 8px 20px rgba(0, 150, 167, 0.4);
}

/* ===== API GRID ===== */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 25px;
    margin: 30px 0;
    justify-items: center;
}

.api-card {
    flex: 1;
    min-width: 320px;
    max-width: 420px;
    width: 100%;
    padding: 28px 25px !important;
    display: flex;
    flex-direction: column;
}

.api-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #00ffd9;
}

body.light-mode .api-card h3 {
    color: #006a73;
}

.api-card label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #00ffd9;
    font-size: 0.9rem;
}

body.light-mode .api-card label {
    color: #006a73;
}

.api-card input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(0, 173, 181, 0.3);
    border-radius: 8px;
    background: rgba(0, 173, 181, 0.1);
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.api-card input:focus {
    border-color: #00adb5;
    background: rgba(0, 173, 181, 0.2);
    outline: none;
    box-shadow: 0 0 8px rgba(0, 173, 181, 0.3);
}

body.light-mode .api-card input {
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    border-color: rgba(0, 173, 181, 0.4);
}

.api-card button {
    width: 100%;
    background: linear-gradient(90deg, #00adb5, #00ffd9);
    color: #222;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 15px;
}

.api-card button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 173, 181, 0.3);
}

.api-card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-card {
    margin-top: 15px;
    padding: 18px;
    background: linear-gradient(120deg, rgba(0, 173, 181, 0.15), rgba(34, 40, 49, 0.85));
    border: 2px solid #00ffd9;
    border-radius: 10px;
    animation: slideIn 0.4s ease;
    display: none;
}

.result-card.show {
    display: block;
}

.result-card.hidden {
    display: none;
}

.api-joke,
.api-weather,
.api-result {
    color: #e0f7fa;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

body.light-mode .result-card {
    background: linear-gradient(120deg, #e0f7fa, #e7eff8);
    border-color: #00adb5;
}

body.light-mode .api-joke,
body.light-mode .api-weather,
body.light-mode .api-result {
    color: #111;
}

@media (max-width: 768px) {
    .api-grid {
        grid-template-columns: 1fr;
    }

    .api-card {
        max-width: 100%;
    }
}

/* ===== FOOTER ===== */
footer {
    margin-top: 100px;
    padding: 50px 20px 30px;
    border-top: 1px solid rgba(0, 173, 181, 0.2);
    background: linear-gradient(135deg, rgba(32, 54, 64, 0.5), rgba(15, 28, 42, 0.7));
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto 30px;
}

.footer-section h4 {
    color: #00ffd9;
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.light-mode .footer-section h4 {
    color: #006a73;
}

.footer-section p,
.footer-section a {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.6;
}

.footer-section a {
    color: #00adb5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #00ffd9;
    text-decoration: underline;
}

body.light-mode .footer-section p {
    color: #555;
}

body.light-mode .footer-section a {
    color: #0097a7;
}

body.light-mode .footer-section a:hover {
    color: #006a73;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(0, 173, 181, 0.2);
    padding-top: 20px;
    color: #888;
    font-size: 0.85rem;
}

body.light-mode footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 640px) {
    footer {
        padding: 40px 20px 25px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section h4 {
        font-size: 0.95rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }
}

/* Enhanced footer polish */
.footer-bottom p:last-child {
    animation: fadeInScale 1s ease-out 0.5s both;
}

/* ===== FLOATING BUTTONS ===== */
.floating-container {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 999;
    animation: float 3s ease-in-out infinite;
}

.floating-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 12px;
}

.floating-button img {
    width: 28px;
    height: 28px;
}

.floating-button:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.github {
    background-color: #333;
}

.github img {
    filter: invert(1);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

@media (max-width: 640px) {
    .floating-container {
        bottom: 20px;
        right: 15px;
    }

    .floating-button {
        width: 50px;
        height: 50px;
    }

    .floating-button img {
        width: 25px;
        height: 25px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced card animations */
.cta-card {
    animation: slideUp 0.6s ease forwards;
}

.cta-card:nth-child(2) {
    animation-delay: 0.1s;
}

.cta-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* ===== ACCESSIBILITY ===== */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid #00adb5;
    outline-offset: 2px;
}

.cta-button:focus,
.cta-button.secondary-btn:focus {
    outline: 3px solid #00ffd9;
    outline-offset: 2px;
}

/* Improve link color contrast */
a {
    color: #00adb5;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #00ffd9;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* ===== TEXT HIGHLIGHTS ===== */
.name-highlight {
    background: linear-gradient(90deg, #00ffd9, #00adb5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: gradientShift 3s ease-in-out infinite;
}

body.light-mode .name-highlight {
    background: linear-gradient(90deg, #006a73, #0097a7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(0, 173, 181, 0.3);
    border-top-color: #00adb5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
    color: #00adb5;
    font-weight: 600;
}

/* ===== RESULT CARD ENHANCEMENTS ===== */
.result-card.show {
    display: block;
    animation: slideIn 0.4s ease;
}

joke-content,
country-content,
dog-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.joke-setup {
    font-style: italic;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.joke-punchline {
    font-weight: 600;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 173, 181, 0.2);
    font-size: 1rem;
}

/* Back to top button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #00adb5;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 998;
}

#back-to-top.show {
    display: flex;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0, 173, 181, 0.4);
}
