body, html {
    height: auto;
    min-height: 100%;
    font-size: 16px;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
}

#background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: -1;
    pointer-events: none;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
    min-width: 342px;
    box-sizing: border-box;
}

.header-top {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.header h1 {
    color: #f0f0f0;
    margin: 0;
}

.header p {
    color: #c7c7c7;
    line-height: 1.6;
    margin: 0;
    max-width: 600px;
}

.waving-emoji {
    display: inline-block;
    transition: transform 0.3s ease;
    transform-origin: 70% 70%;
}

.waving-emoji:hover,
.waving-emoji.waving {
    animation: wave 0.8s infinite linear;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-20deg); }
    100% { transform: rotate(0deg); }
}

@property --my-border {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}

.profile-pic-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin-right: 20px;
    box-sizing: border-box;
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-pic-container:after {
    content: "";
    position: absolute;
    inset: -4px;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    background: repeating-conic-gradient(
        #007bff 0%,
        #007bff var(--my-border),
        transparent var(--my-border),
        transparent 100%
    );
    transform: rotate(-180deg) scale(-1, 1);
    transition: --my-border 2.5s ease, opacity 2.5s ease;
}

.profile-pic-container:hover:after,
.profile-pic-container:active:after {
    --my-border: 100%;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
}

.confetti {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: confetti-explode 1.5s ease-out;
    border-radius: 50%;
    padding: 5px;
}

/* Projects Section */

.projects-section {
    max-width: 600px;
    margin: 1rem auto;
    padding: 0 1rem;
    position: relative;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

#project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-card {
    background: rgba(34, 34, 34, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    padding-bottom: 1rem;
    text-decoration: none;
    color: inherit;
}

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

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.project-card h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.4rem;
    color: #f0f0f0;
}

.project-card p {
    padding: 0 1rem;
    color: #c7c7c7;
}

/* More Projects Button (Top Right) */

.more-projects-container-top a {
    color: #f0f0f0;
    font-size: 16px;
    text-decoration: none;
    position: relative;
    padding-right: 1.5rem;
    transition: color 0.3s ease;
}

.more-projects-container-top a:hover {
    color: #c7c7c7;
}

.more-projects-container-top a::after {
    content: '➜';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.more-projects-container-top a:hover::after {
    transform: translateX(0.3rem) translateY(-50%);
}

.more-projects-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.widgets {
    max-width: 600px;
    padding: 0 1rem;
    margin: auto;
    margin-top: 2rem;
}

.card {
    background-color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    box-sizing: border-box;
    padding-bottom: 1px;
}

/* Capybara Typing Test */

.capybara {
    position: absolute;
    top: 65px;
    left: 10px;
    z-index: 1;
    pointer-events: none;
    width: auto;
}

.typing-container {
    position: relative;
    text-align: center;
    padding: 20px;
    background-color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    margin: 20px auto;
}

.typing-container input {
    width: 100%;
    padding: 10px;
    margin-top: 70px;
    border: 1px solid #555;
    border-radius: 5px;
    box-sizing: border-box;
    position: relative;
    color: #f0f0f0;
    background-color: #333;
}

.typing-container p:first-child {
    margin-top: 10px;
    color: grey;
}

.typing-container .correct {
    color: white;
}

.typing-container .incorrect {
    color: red;
}

.typing-container p:nth-child(3) {
    color: #c7c7c7;
}

.typing-container .timer-indicator-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.typing-container .restart-indicator {
    font-size: 0.8em;
    color: #888;
}

.typing-container .timer-display {
    font-size: 0.9em;
}

@keyframes confetti-explode {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--rotate, 0deg)) scale(2);
    }
}

.handwriting-recognition-container {
    text-align: center;
    margin: 20px auto 50px;
    max-width: 600px;
    box-sizing: border-box;
    color: #f0f0f0;
}

#drawingCanvas {
    border: 2px solid #555;
    margin-bottom: 10px;
    box-sizing: border-box;
    cursor: default;
    background-color: #333;
}

#drawingCanvas.drawing-active {
    cursor: url("assets/images/pencil.png") 0 24, auto;
}

#clearButton, #recognizeButton {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    background-color: #444;
    color: #f0f0f0;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-size: 16px;
    box-sizing: border-box;
}

#clearButton:hover, #recognizeButton:hover {
    background-color: #555;
    transition: background-color 0.3s ease;
}

#resultDisplay {
    margin-top: 16px;
    color: #c7c7c7;
}

/* Cat Quiz Styles */
#cat-quiz-container {
    background-color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
    position: relative;
    color: #f0f0f0;
}

#cat-quiz-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #f0f0f0;
}

#question-container {
    margin-bottom: 20px;
}

#question-container h2{
    font-size: 20px;
}

.quiz-blurb{
    color: #a0a0a0;
    font-size: 0.8em;
}

#question-container button {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    background-color: #444;
    color: #f0f0f0;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-size: 16px;
    box-sizing: border-box;
    width: 230px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


#question-container button:hover {
    background-color: #555;
    transition: background-color 0.3s ease;
}

.responsive-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 8px;
  }


#results-container {
    display: none;
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #555;
    padding-top: 20px;
}

#results-container h2 {
    font-size: 22px;
    color: #f0f0f0;
    margin-bottom: 15px;
}

#results-container p {
    font-size: 18px;
    color: #c7c7c7;
    line-height: 1.6;
}

#restart-button {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    width: 30px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-image: url('assets/images/restart_light.png');
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

#restart-button:hover {
    transform: rotate(180deg);
}



/* Metaballs Widget */
#mb-start-btn:hover {
    background-color: #0056b3 !important;
}

#mb-stop-btn:hover {
    background-color: #a71d2a !important;
}

#metaballs-widget {
    background-color: #222;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

#metaballs-widget h1 {
    color: #f0f0f0;
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 720px) {

    .handwriting-recognition-container {
        max-width: 100%;
        padding: 0 10px;
    }

    #drawingCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {

    body {
        padding: 10px;
    }

    .handwriting-recognition-container {
        margin: 10px auto;
    }

    #drawingCanvas {
        border-width: 1px;
    }

    #clearButton, #recognizeButton {
        padding: 8px 16px;
        font-size: 14px;
    }

    .capybara {
        position: absolute;
        height: 50px;
        top: 85px;
        left: 10px;
        z-index: 1;
        pointer-events: none;
        transition: top 0.3s ease;
    }

    .responsive-image {
        max-width: 90%;
    }
}
@media (max-width: 420px) {
    .capybara {
        position: absolute;
        height: 50px;
        top: 105px;
        left: 10px;
        z-index: 1;
        pointer-events: none;
        transition: top 0.3s ease;
    }
}
