:root {
    --dark-title: #550C18;
    --title: #992243;
    --golden: #D5C9C3;
    --slate: #2E2E2E;
    --light-grey: #666671;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--slate);
    background: #ffffff;
    padding-top: 180px;
    margin: 0;
}

/* Two column layout */
.cv-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

main {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--golden);
    border-top: 5px solid var(--title);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
    0% { 
        opacity: 1;
        visibility: visible;
    }
    100% { 
        opacity: 0;
        visibility: hidden;
    }
}

.preloader.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

footer {
    width: 100%;
    background: var(--dark-title);
    color: var(--golden);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    bottom: 0;
    text-align: center;
    padding: 14px 0;
}

footer p {
    color: var(--golden);
}

#js-banner {
  border: 1px solid #551018;
  background-color: pink;
  text-align: center;
  padding: 64px;
  border-radius: 10px;
  color: red;
}

#js-banner p{
  color: red;
}

.hidden {
    display: none !important;
}

.main-col {
    flex: 0 7 7;
}

.side-col {
    flex: 0 3 3;
}

/* Header Styles */
.cv-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 2px solid var(--golden);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.profile-photo {
    height: 80px;
    border-radius: 50%;
    background: var(--golden);
    overflow: hidden;
    border: 3px solid var(--dark-title);
    flex: 80px 0 0;
    text-align: center;
    align-self: flex-start;
    box-shadow: inset 1px 1px 8px rgba(0, 0, 0, 0.3);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info, contact-info {
    display: flex;
    gap: 20px;
    width: 100%;
}

.profile-info {
    margin-bottom: 20px;
    justify-content: space-between;
}

.profile-info h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-title);
    line-height: 1.2;
}

.profile-info p {
    margin: 0;
    font-size: 13px;
    color: var(--title);
    font-weight: 500;
}

.header-menu-btn {
    border: none;
    color: var(--title);
    font-size: 20px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    align-self: center;
    position: relative;
    top: 0;
    right: 0;
}

.header-menu-btn:hover {
    background: var(--golden);
}

#switch-lang-EN, #switch-lang-IT {
    font-size: 14px;
    padding: 8px;
    border: 1px solid var(--dark-title);
    border-radius: 30px;
    margin: 0 auto;
}

/* Contact Info Display */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

.contact-item {
    margin: 0;
    font-size: 13px;
    color: var(--light-grey);
}

.contact-item i {
    color: var(--title);
    font-size: 14px;
}

.contact-item a {
    color: var(--title);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-item a:hover {
    color: var(--dark-title);
}


/* Navigation Menu */
.nav-menu {
    z-index: 100;
    position: absolute;
    top: 0;
    right: 0;
    background: white;
    border: 1px solid var(--golden);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    transform: scale(0);
    transform-origin: top right;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.nav-menu.active {
    transform: scale(1);
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu li > * {
    display: block;
    padding: 12px 16px;
    color: var(--slate);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.nav-menu li:last-child > * {
    border-bottom: none;
}

.nav-menu li > a:hover {
    background: var(--golden);
    color: var(--dark-title);
    padding-left: 20px;
}

.contact-info-sm {
    background-color: #f0f0f0;
}

section {
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 48px;
}


h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-title);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-left: 16px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--title);
    border-radius: 2px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 8px;
    line-height: 1.4;
}

h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--light-grey);
    margin-bottom: 6px;
    font-style: italic;
}

p {
    font-size: 15px;
    color: var(--light-grey);
    margin-bottom: 12px;
    line-height: 1.7;
}

p:empty {
    display: none;
}

em {
    color: var(--slate);
    font-style: italic;
}

ul {
    margin: 16px 0;
    padding-left: 24px;
}

li {
    font-size: 15px;
    color: var(--light-grey);
    margin-bottom: 8px;
    line-height: 1.7;
    position: relative;
}

li::marker {
    color: var(--title);
    font-size: 18px;
}

hr {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--golden), transparent);
    margin: 32px 0;
    border: none;
}

/* Skills styling */
span.cvskill {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px 8px 4px 0;
    background: #faf8f7;
    border: 1px solid var(--golden) !important;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate);
    transition: all 0.2s ease;
}

#switch-lang-IT:hover, #switch-lang-EN:hover {
    background: var(--golden);
    border-color: var(--title) !important;
}

span.cvskill span:last-child {
    margin-left: 10px;
}

/* Language table styling */
.language-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #faf8f7;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.language-table th {
    color: var(--dark-title);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--dark-title);
}

.language-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--golden);
    text-align: center;
    font-size: 14px;
    color: var(--slate);
}

.language-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: rgba(193, 181, 175, 0.1);
}

.language-table tr:last-child td {
    border-bottom: none;
}

.language-table .native-lang {
    font-style: italic;
    text-align: center;
    color: var(--light-grey);
}

.language-table .skill-level {
    font-weight: 500;
}

@media (max-width: 768px) {
    .language-table {
        font-size: 13px;
    }

    .language-table th,
    .language-table td {
        padding: 8px 12px;
    }

    .lang-label {
	display: none;
    }
}

@media (max-width: 480px) {
    .language-table {
        font-size: 12px;
    }

    .language-table th,
    .language-table td {
        padding: 6px 8px;
    }

    .language-table th {
        font-size: 11px;
    }

    .contact-info {
	flex-direction: column;
    }
    .header-profile {
	flex-direction: column;
    }

    .profile-photo {
	align-self: center;
    }
}

/* Skill level indicators
span.cvskill span:contains("🔴🔴🔴") {
    background: #dcfce7;
    border-color: #bbf7d0 !important;
    color: #166534;
}

span.cvskill span:contains("🔴🔴⭕") {
    background: #fef3c7;
    border-color: #fde68a !important;
    color: #92400e;
}

span.cvskill:contains("🔴⭕⭕") {
    background: #fee2e2;
    border-color: #fecaca !important;
    color: #991b1b;
} */

.bottom-corner {
    position: absolute;
    bottom: 0;
    right: 0;
}


.corner-fold-beneath {
    width: 100px;
    height: 80px;
    background-color: #98473E;
    color: var(--slate);
    text-align: right;
    cursor: pointer;
    padding-right: 15px;
    box-shadow: inset -2px -2px 10px black;
    transition: background-color 0.5s ease;
}

.corner-fold-beneath:hover {
    background-color: #BB804C;
}

.corner-fold-beneath p {
    margin: 0;
}
.corner-fold-beneath a {
    position: relative;
    top: 20px;
    text-decoration: none;
    color: white;
}

.corner-fold {
    background-color: transparent;
    background-image: url("fold.png");
    background-size: cover;
    width: 110px;
    height: 80px;
    position: absolute;
    bottom: 0;
    transform: translate(-10px);
    transition: transform 0.3s ease;
}

.corner-fold:hover {
    transform: translate(-30px) scaleX(1.15);
}

.contact-info-sm {
    display: none;
}

.contact-info-sm > span {
    color: var(--light-grey);
}

footer {
    display: flex;
}

footer > div:first-child {
    flex-grow: 1;
    margin-left: 10px;
}
footer > div:last-child {
    flex-grow: 0;
    width: 160px;
    flex-shrink: 0;
    height: 60px;
}

.copyleft-logo {
    margin-bottom: -3px;
    width: 16px;
    height: 16px;
}

@media (min-width: 900px) {
    main > div:first-child {
	margin-left: 20px;
    }

    main > div:last-child {
	margin-right: 20px;
    }
}

/* Responsive design */
@media (max-width: 900px) {
    .header-profile {
        gap: 12px;
    }

    .profile-info h1 {
        font-size: 20px;
    }

    .profile-info p {
        font-size: 12px;
    }

    main {
        flex-direction: column;
	gap: 10px;
	margin: 0 20px;
    }

    body {
	padding-top: 140px;
    }

    .header-content {
        padding: 12px 16px;
    }

}

@media (max-width: 768px) {

    h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 15px;
    }

    p, li {
        font-size: 14px;
    }

    span.cvskill {
        font-size: 13px;
        padding: 6px 12px;
        margin: 3px 6px 3px 0;
    }


    .contact-info-sm {
	display: block;
    }

    .contact-info {
	display: none;
    }

    .profile-info {
	margin-bottom: 0;
    }

    .nav-menu {
	width: 300px;
    }
}

@media (max-width: 480px) {
    main {
	margin: 0 10px;
    }

    body {
	padding-top: 180px;
    }

    .header-content {
        padding: 10px 12px;
    }

    .profile-info h1 {
        font-size: 18px;
    }

    .profile-info p {
        font-size: 11px;
    }

    h2 {
        font-size: 18px;
        padding-left: 12px;
    }

    h2::before {
        width: 3px;
    }

    h3 {
        font-size: 16px;
    }

    h4 {
        font-size: 14px;
    }

    p, li {
        font-size: 13px;
    }

    span.cvskill {
        font-size: 12px;
        padding: 5px 10px;
        margin: 2px 4px 2px 0;
    }

    footer {
	flex-direction: column;
    }

    footer > div:last-child {
	display: none
    }
}

/* Print styles */
@media print {
    body {
        box-shadow: none;
        border: none;
        padding: 0;
        max-width: 100%;
        margin: 0;
        background: white;
        padding-top: 0;
    }

    .cv-header {
        position: static;
        border-bottom: 2px solid #000;
        margin-bottom: 20px;
        page-break-after: avoid;
    }

    .header-menu-btn,
    .nav-menu {
        display: none !important;
    }

    .contact-info {
        display: flex !important;
    }

    section {
        page-break-inside: avoid;
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    h2 {
        color: #000;
        page-break-after: avoid;
    }

    h3 {
        page-break-after: avoid;
    }

    hr {
        background: #ccc;
        margin: 16px 0;
    }

    span.cvskill {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
    }

    footer > div:last-child {
	display: none
    }

}
