/* =============================================
   Illustrative UI Portfolio - Styles
   A hand-drawn, sketch-style portfolio design
   ============================================= */

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    content-visibility: auto;
}

.project-card, .sketch-border, .wiggle {
    will-change: transform;
    contain: layout style paint;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

html,
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: hidden;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif !important;
}

/* Preserve Font Awesome icons */
.fa,
.fas,
.far,
.fal,
.fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

/* =============================================
   Sketch Border Effect
   ============================================= */

.sketch-border {
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    border: 3px solid #2ECC40;
}

/* =============================================
   Doodle Background Pattern
   ============================================= */

.doodle-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232ECC40' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* =============================================
   Hand-drawn Filter Effect
   ============================================= */

.hand-drawn {
    filter: url(#roughPaper);
}

/* =============================================
   Highlighted Section (for editing mode)
   ============================================= */

.highlighted-section {
    outline: 2px solid #3F20FB;
    background-color: rgba(63, 32, 251, 0.1);
}

.edit-button {
    position: absolute;
    z-index: 1000;
}

/* =============================================
   Intro Section - Desktop
   ============================================= */

.intro-name {
    display: inline;
}

/* =============================================
   Section Animations
   ============================================= */

section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   Skill Progress Bars
   ============================================= */

.skill-item .bg-bright-green {
    transition: width 1s ease-out;
}

/* =============================================
   Card Hover Effects
   ============================================= */

.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: scale(1.05) rotate(0deg) !important;
}

/* =============================================
   Button Styles
   ============================================= */

.btn-primary {
    background-color: #2ECC40;
    color: white;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-secondary {
    border: 4px solid #2ECC40;
    color: #2ECC40;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.btn-secondary:hover {
    transform: scale(1.05);
}

/* =============================================
   Form Styles
   ============================================= */

input,
select,
textarea {
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2ECC40;
    box-shadow: 0 0 0 2px rgba(46, 204, 64, 0.2);
}

/* Dark mode form styles */
.dark input,
.dark select,
.dark textarea {
    background-color: #374151;
    color: white;
}

/* =============================================
   Testimonial Cards
   ============================================= */

.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 2rem;
    width: 2rem;
    height: 2rem;
    background: inherit;
    transform: rotate(45deg);
}

/* =============================================
   Stats Counter Animation
   ============================================= */

.stat-number {
    font-variant-numeric: tabular-nums;
}

/* =============================================
   Timeline Styles
   ============================================= */

.timeline-line {
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 0.25rem;
    background-color: #2ECC40;
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-dot {
    position: absolute;
    left: 2rem;
    transform: translateX(-50%);
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 4px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .timeline-dot {
        left: 50%;
    }
}

/* =============================================
   Project Card Styles
   ============================================= */

.project-card {
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: scale(1.05);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* =============================================
   Social Icon Styles
   ============================================= */

.social-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* =============================================
   Back to Top Button
   ============================================= */

#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =============================================
   Mobile Menu Styles
   ============================================= */

#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

#mobile-menu.hidden {
    max-height: 0;
}

#mobile-menu.flex {
    max-height: 500px;
}

/* =============================================
   Dark Mode Overrides
   ============================================= */

.dark .bg-soft-gray {
    background-color: #111827;
}

.dark .text-deep-blue {
    color: #f9fafb;
}

.dark .border-bright-green {
    border-color: #2ECC40;
}

/* =============================================
   Quote Marks
   ============================================= */

.quote-mark {
    font-size: 4rem;
    color: #2ECC40;
    opacity: 0.2;
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
}

/* =============================================
   Fun Rotations
   ============================================= */

.rotate-1 {
    transform: rotate(1deg);
}

.rotate-2 {
    transform: rotate(2deg);
}

.rotate-3 {
    transform: rotate(3deg);
}

.-rotate-1 {
    transform: rotate(-1deg);
}

.-rotate-2 {
    transform: rotate(-2deg);
}

.-rotate-12 {
    transform: rotate(-12deg);
}

.rotate-12 {
    transform: rotate(12deg);
}

.rotate-45 {
    transform: rotate(45deg);
}

/* =============================================
   Responsive Adjustments
   ============================================= */

@media (max-width: 768px) {
    .sketch-border {
        border-width: 2px;
    }

    h1 {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Header Mobile Fixes */
    .logo-text {
        font-size: 1rem !important;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logo-initial-container {
        width: 2.5rem !important;
        height: 2.5rem !important;
        min-width: 2.5rem;
    }

    .logo-initial {
        font-size: 1rem !important;
    }

    /* Intro Section Mobile */
    #intro {
        padding-top: 6rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-top: 0 !important;
        margin-bottom: 2rem !important;
    }

    #intro .w-48 {
        width: 8rem !important;
        height: 8rem !important;
    }

    #intro .absolute.-top-4.-right-4 {
        width: 3.5rem !important;
        height: 3.5rem !important;
        top: -0.5rem !important;
        right: -0.5rem !important;
    }

    .intro-greeting {
        font-size: 1.75rem !important;
        transform: none !important;
    }

    .intro-name {
        display: block;
        font-size: 1.75rem !important;
    }

    .intro-tagline {
        font-size: 1rem !important;
        transform: none !important;
    }

    .intro-description {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }

    /* About Section Mobile */
    #about {
        padding: 3rem 1rem !important;
    }

    #about .grid {
        gap: 1.5rem !important;
    }

    /* Skills Section Mobile */
    #skills {
        padding: 3rem 1rem !important;
    }

    #skills .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Tech Arsenal - 4 items per row on mobile */
    #skills .grid.grid-cols-4 {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
    }

    #skills .grid.grid-cols-4 .w-16 {
        width: 3rem !important;
        height: 3rem !important;
    }

    #skills .grid.grid-cols-4 .text-2xl {
        font-size: 1rem !important;
    }

    #skills .grid.grid-cols-4 .text-sm {
        font-size: 0.7rem !important;
    }

    /* Experience Section Mobile */
    #experience {
        padding: 3rem 1rem !important;
    }

    .timeline-line {
        left: 1rem !important;
    }

    .timeline-dot {
        left: 1rem !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    /* Projects Section Mobile */
    #projects {
        padding: 3rem 1rem !important;
    }

    .projects-filters {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .projects-filters button {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .project-card {
        transform: none !important;
    }

    .project-card:hover {
        transform: scale(1.02) !important;
    }

    /* Testimonials Section Mobile */
    #testimonials {
        padding: 3rem 1rem !important;
    }

    #testimonials .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Stats Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* Contact Section Mobile */
    #contact {
        padding: 3rem 1rem !important;
    }

    #contact .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    #contact form {
        padding: 1.5rem !important;
    }

    #contact .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Contact Social Links Mobile */
    #contact .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Footer Mobile */
    #footer {
        padding: 3rem 1rem !important;
    }

    #footer .grid.md\:grid-cols-4 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto;
        gap: 1.5rem !important;
    }

    /* First section (logo + tagline) - full width, centered */
    #footer .grid.md\:grid-cols-4 > div.md\:col-span-2 {
        grid-column: 1 / 3;
        grid-row: 1;
        text-align: center;
    }

    /* Quick Links - left column */
    #footer .grid.md\:grid-cols-4 > div:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        text-align: left;
    }

    /* Services - right column */
    #footer .grid.md\:grid-cols-4 > div:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }

    #footer .flex.space-x-4 {
        justify-content: center !important;
    }

    /* Header buttons spacing */
    header .flex.items-center.space-x-4 {
        gap: 1.25rem !important;
    }

    /* Button Mobile Adjustments */
    .btn-primary, .btn-secondary,
    #contact form button[type="submit"] {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Keep header buttons at original size */
    #theme-toggle,
    #mobile-menu-btn {
        width: 2.5rem !important;
        height: 2.5rem !important;
        padding: 0 !important;
    }

    /* Form Mobile */
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Hide decorative elements on mobile */
    .absolute.-right-8,
    .rotate-12.text-4xl {
        display: none !important;
    }

    /* Card padding adjustments */
    .p-8 {
        padding: 1.25rem !important;
    }

    .p-6 {
        padding: 1rem !important;
    }

    /* Spacing adjustments */
    .space-x-6 > * + * {
        margin-left: 1rem !important;
    }

    .mb-8 {
        margin-bottom: 1.5rem !important;
    }

    .mb-12 {
        margin-bottom: 2rem !important;
    }

    /* Text sizes */
    .text-6xl {
        font-size: 2rem !important;
    }

    .text-5xl {
        font-size: 1.75rem !important;
    }

    .text-4xl {
        font-size: 1.5rem !important;
    }

    .text-3xl {
        font-size: 1.25rem !important;
    }

    .text-2xl {
        font-size: 1.125rem !important;
    }

    .text-xl {
        font-size: 1rem !important;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .logo-text {
        display: none !important;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    .intro-greeting,
    .intro-name {
        font-size: 1.5rem !important;
    }

    #intro .w-48 {
        width: 6rem !important;
        height: 6rem !important;
    }
}

/* =============================================
   Bounce Animation
   ============================================= */

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%) translateX(-50%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0) translateX(-50%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* =============================================
   Star Rating
   ============================================= */

.star-rating {
    display: flex;
    gap: 0.125rem;
}

.star-rating i {
    color: #EAB308;
}
