* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 1rem;
    font-size: 16px;
}

.wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: grid;
    grid-template-areas:
        "ThemeSwitch . LangSelector"
        "TitleHeader TitleHeader TitleHeader";
    grid-template-columns: 1fr auto 1fr;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 2rem 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.TitleHeader {
    grid-area: TitleHeader;
}

.LangSelector {
    grid-area: LangSelector;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#languageSelect {
    padding: 0.3rem;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.main,
.aside {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.377);
    width: fit-content;
    height: fit-content;
}

.footer {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.377);
    display: flex;
    flex-direction: column;
    /* align-items: center; */
}

.footerTitle {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    text-align: left;
}

.footerGrid {
    display: grid;
    gap: 1rem;
}

.footerPdf {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.377);
    display: flex;
    flex-direction: column;
    align-items: center;
    place-self: center;
}

.footerLink {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.377);
    display: flex;
    flex-direction: column;
    align-items: center;
    place-self: center;
}

.footerQrCode {
    margin-top: 1rem;
}
.QrcodeDarkMode{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    width: 138px;
    height: 138px;
    border-radius: 5px;
}

@media (min-width: 768px) {
    .footerGrid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (min-width: 1024px) {
    .footerGrid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footerTitle {
        text-align: left;
    }
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    position: relative;
}

.progressBarForList {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.progressBarForList::before {
    content: "Nivel:";
    font-weight: 600;
    margin-right: 0.3rem;
}

.importantList:before {
    content: "▾";
    color: #3498db;
    position: absolute;
    left: 0;
}


.importantListCollapsed:before {
    content: "▸";
    color: #3498db;
    position: absolute;
    left: 0;
    
}
.importantListCollapsed {
    display: none;
}


.importantList {
    cursor: pointer;
    margin-bottom: 0;
    color: #73a3d2;
    font-weight: bold;

    ul {
        padding-left: 1.5rem;
        color: #308d2a;
    }

    li:before {
        content: "▸";
        color: #3498db;
        position: absolute;
        left: 0;
    }
}

li:before {
    content: "▸";
    color: #3498db;
    position: absolute;
    left: 0;
}

fieldset {
    border: 2px solid #98a0a5;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

legend {
    font-weight: bold;
    color: #5481ae;
    padding: 0 0.5rem;
}

.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.25rem;
}

#themeClipboard {
    position: relative;
    display: flex;
    justify-content: center;
    direction: rtl;
}

#copyCheckbox {
    display: none;
}




#copyCheckbox:checked+label::after {
    content: " Copiado ✓";
    color: green;
    font-size: 0.9rem;
    margin-left: 0.3rem;
    animation: fadeOutCopy 2.5s forwards;
}

@keyframes fadeOutCopy {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.contactItem {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
}

/* For Tablet */
@media (min-width: 768px) {
    body {
        padding: 1.5rem;
        font-size: 17px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .wrapper {
        gap: 2rem;
    }

    .main,
    .aside,
    .footer {
        padding: 2rem;
    }

    .aside {
        justify-self: center;
    }

    .main {
        justify-self: center;
    }


    .asideContainer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 2rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .wrapper {
        display: grid;
        grid-template-areas:
            "header header"
            "main main"
            "aside1 aside1"
            "aside2 aside2"
            "aside3 aside3"
            "footer footer"
            "footerPdf footerPdf"
            "footerLink footerLink";
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }

    .header {
        grid-area: header;
    }

    .main {
        grid-area: main;
    }

    .aside1 {
        grid-area: aside1;
    }

    .aside2 {
        grid-area: aside2;
    }

    .aside3 {
        grid-area: aside3;
    }

    .footer {
        grid-area: footer;
        display: flex;
        flex-direction: column;
    }

    .footerPdf {
        grid-area: footerPdf;
    }

    .footerLink {
        grid-area: footerLink;
    }

    .footerQrCode {
        grid-area: footerQrCode;
    }
}

/* For PC */
@media (min-width: 1200px) {
    .wrapper {
        grid-template-areas:
            "header header header"
            "main aside1 aside1"
            "main aside2 aside2"
            "main aside3 aside3"
            "footer footer footer"
            "footerPdf footerLink footerQrCode";
        grid-template-columns: 3fr 2fr;
    }

    .main {
        min-height: 400px;
    }
}

.skillTags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skillTag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

#OpenAppGro {

    cursor: not-allowed;
}

.projectLink {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

a:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        margin-top: 20px;
    }

    to {
        opacity: 1;
        margin-top: 0;
    }
}


.themeSwitch {
    grid-area: ThemeSwitch;
    position: relative;
    display: flex;
    direction: rtl;
    justify-content: flex-end;
    align-items: center;
}

#themeCheckbox {
    display: none;
}

#themeCheckbox+label {
    font-size: 2rem;
    height: 1em;
    width: 2.5em;
    border-radius: 0.25em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    background-color: #cecece;
    position: relative;
}

#themeCheckbox:checked+label {
    background-color: #3a3a3a;
}

#themeCheckbox+label:active {
    transform: scale(0.84);
    transition: transform 0.2s;
}

#themeCheckbox+label div {
    width: 0.8em;
    height: 0.8em;
    border-radius: inherit;
    position: absolute;
    top: 0.1em;
    left: 0.1em;
    z-index: 10;
    transition: 0.5s cubic-bezier(1, 0.33, 0.11, 1.34);
    background-color: #f2f2f2;
}

#themeCheckbox:checked+label div {
    left: 1.6em;
    background-color: #212121;
}

#themeCheckbox+label span {
    display: flex;
}

#themeCheckbox+label svg {
    display: inline-block;
    height: 1em;
    width: 1em;
    padding: 0.15em;
    box-sizing: border-box;
}

#themeCheckbox+label span:first-of-type {
    color: #3a3a3a;
}

#themeCheckbox+label span:last-of-type {
    color: #cecece;
}

.header,
.main,
.aside,
.footer,
.footerPdf,
.footerLink {
    animation: fadeIn 0.6s ease-out;
    transition: all 0.0s ease-in;
    background-color: #8080801f;
}

.darkMode .btn:hover {
    background: #1a5276;
}

.darkMode a {
    color: #3498db;
}

.darkMode a:hover {
    color: #2980b9;
}

.darkMode path {
    fill: #f0f0f0;
}

.darkMode .btn,
.darkMode h2 {
    color: #ffffff;
}

.darkMode {
    background-color: #0d1117;
    color: #ffffff;
}

.gitLink svg {
    fill: #0366d6;
    vertical-align: middle;
}

@media print {
    @page {
        margin: 0;
    }

    body {
        zoom: 0.68;
        transform: scale(0.99);
    }

    .header {
        display: block !important;
    }

    .wrapper {
        display: grid !important;
        max-width: 100%;
        margin: 0;
        padding: 0.25rem;
        grid-template-areas:
            "header header header"
            "main aside1 aside1"
            "main aside2 aside2"
            "main aside3 aside3"
            "footer footer footer"
            "footerLink footerQrCode footerQrCode";
        grid-template-columns: 2fr 1fr;
        gap: 0.5rem;
        page-break-inside: avoid;
    }

    /* ensure grid areas are set for print (they are only set at desktop breakpoints otherwise) */
    .header {
        grid-area: header;
    }

    .main {
        grid-area: main;
    }

    .aside1 {
        grid-area: aside1;
    }

    .aside2 {
        grid-area: aside2;
    }

    .aside3 {
        grid-area: aside3;
    }

    .footer {
        grid-area: footer;
    }

    .footerPdf {
        grid-area: footerPdf;
    }

    .footerLink {
        grid-area: footerLink;
    }

    .footerQrCode {
        grid-area: footerQrCode;
    }

    /* hide UI controls */
    #pdfWrapper,
    .LangSelector,
    .themeSwitch,
    .btn,
    .BtnCopy {
        display: none !important;
    }

    /* compact styles to save space */
    .header,
    .main,
    .aside,
    .footer,
    .footerGrid,
    .contactItem,
    .skillTags {
        padding: 0.35rem !important;
        margin: 0 !important;
        border-radius: 4px !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .header h1 {
        font-size: 18px;
        /* margin-bottom: 0.1rem; */
    }

    .header p {
        font-size: 16.5px;
        /* margin-bottom: 0.1rem; */
    }

    .aside,
    .main {
        width: fit-content;
        height: fit-content;
    }

    .footer {
        padding: 0.35rem;
    }

    .footerGrid {
        gap: 0;
        grid-template-columns: repeat(3, 1fr);
    }

    .projectLink {
        display: inline-block !important;
        font-size: 10px;
    }

    #htmlLinkContainer {
        display: block;
        font-size: 20px;
    }

    svg {
        width: 18px;
        height: 18px;
    }

    fieldset {
        padding: 0.45rem;
        margin: 0.2rem 0;
        border-width: 1px;
    }

    li {
        margin-bottom: 0.25rem;
        padding-left: 0.7rem;
    }
}