/*
 * Made with <3 by Ahmad Y. Khattak
 * GitHub: https://github.com/ahmadkhattak1
 * LinkedIn: https://www.linkedin.com/in/AhmadYKhattak/
 * X: https://x.com/AhmadYKhattak
 */

html {
    font-size: 18px;
}

body {
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    line-height: 1.7;
    color: #222;
    background: #fff;
    max-width: 680px;
    margin: 50px auto;
    padding: 20px;
}

.profile-class {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 45px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #ddd;
}

#profile img {
    width: 140px;
    height: 140px;
    border-radius: 3px;
    object-fit: cover;
    filter: grayscale(20%);
    border: 1px solid #ddd;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

#profile img:hover {
    box-shadow: -6px 6px 0 rgba(220, 20, 60, 0.6);
}

/* Image Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    padding: 20px;
    background: #fff;
    border: 2px dashed #DC143C;
    box-shadow: -8px 8px 0 rgba(220, 20, 60, 0.3);
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 3px;
    filter: grayscale(20%);
}

.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #DC143C;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 2px;
    font-family: "Courier New", Courier, monospace;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

#name {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0 0 8px 0;
    line-height: 1.2;
    color: #000;
}

#title {
    color: #666;
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.download-cv-btn {
    background: none;
    border: 1px dashed #DC143C;
    color: #DC143C;
    padding: 6px 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    border-radius: 2px;
}

.download-cv-btn:hover {
    background: #DC143C;
    color: #fff;
    box-shadow: -3px 3px 0 rgba(220, 20, 60, 0.3);
}

section {
    margin-bottom: 40px;
}

h2 {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 16px;
    color: #000;
    cursor: default;
    display: inline-block;
    position: relative;
}

h2::before {
    content: "# ";
    color: #999;
    transition: all 0.2s ease;
}

h2:hover::before {
    color: #DC143C;
    text-shadow: 0 0 8px rgba(220, 20, 60, 0.3);
}

p {
    margin-bottom: 12px;
    line-height: 1.8;
}

ul {
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}

li {
    margin-bottom: 10px;
    line-height: 1.7;
}

li::before {
    content: "- ";
    color: #999;
}

ul ul {
    margin-left: 20px;
    margin-top: 8px;
}

ul ul li {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

a {
    color: #DC143C;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, padding 0.2s ease;
    padding: 1px 2px;
    border-radius: 2px;
    cursor: pointer;
}

a:hover {
    background-color: #DC143C;
    color: #fff;
    padding: 1px 4px;
}

a::after {
    content: " ↗";
    font-size: 0.75em;
    opacity: 0.5;
}

/* Link Preview Tooltip */
.link-preview {
    position: fixed;
    background: #fff;
    border: 2px dashed #DC143C;
    border-radius: 3px;
    padding: 6px;
    max-width: 220px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: -4px 4px 0 rgba(220, 20, 60, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.link-preview.visible {
    opacity: 1;
    visibility: visible;
}

.link-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    display: block;
    background: #f5f5f5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
    text-align: center;
    color: #999;
    font-size: 0.8rem;
}

footer::before {
    content: "<!-- made with care -->";
    display: block;
    margin-bottom: 10px;
    color: #ccc;
}

footer .template-attribution {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer .template-attribution:hover {
    color: #fff;
}

/* GitHub Calendar Customization */
.calendar {
    margin-top: 16px;
}

.calendar img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px dashed #ddd;
    padding: 10px;
    background: #fafafa;
    box-sizing: border-box;
}

/* Contact Form Styling */
.contact-toggle {
    margin-bottom: 20px;
}

.contact-button {
    background: none;
    border: none;
    color: #DC143C;
    padding: 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.contact-form {
    border: 1px dashed #DC143C;
    padding: 20px;
    margin-top: 20px;
    background: #fafafa;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.contact-form.hidden {
    display: none;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.form-greeting {
    margin: 0;
    color: #DC143C;
    font-size: 1rem;
}

.close-x {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-x:hover {
    color: #DC143C;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #DC143C;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.submit-btn,
.close-btn {
    padding: 0;
    border: none;
    background: none;
    color: #DC143C;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

@media (max-width: 600px) {
    body {
        margin: 20px auto;
        padding: 25px;
    }

    .profile-class {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .download-cv-btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .submit-btn,
    .close-btn {
        width: 100%;
    }
}
