:root {
    --btn-primary-color: #ffffff;
    --btn-secondary-color: #FBD144;
    --btn-third-color: #D7D7D7;
    --btn-text-color: #3D3D3D;
    --btn-text-hover: #3D3D3D;
    --btn-modal-color: #D7D7D7;
    --theme-icon-color: #3D3D3D;
    --theme-bg-color: #ffffff;
    --theme-ab-color: #3D3D3D;
    --theme-bg-hover-color: #FBD144;
    --icons-primary-color: #3D3D3D;
    --icons-secondary-color: #575757;
    --border-primary-color: #3D3D3D;
    --border-color: #e0e0e0;
    --text-primary-color: #3D3D3D;
    --text-secondary-color: #575757;
    --primary-color: #3D3D3D;
    --secondary-color: #575757;
    --text-color: #575757;
    --bg-color: #e5e5e5;
    --bg--second-color: #FFFFFF;
    --bg-third-color: #ffffff;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0.3, 0.3, 0.3, 0.3);
    --tooltip-color: #ffffff;
}

.dark-mode {
    --icons-primary-color: #F1F2F4;
    --icons-secondary-color: #A3ABB2;
    --btn-primary-color: #1E293B; /* світліший фон */
    --btn-text-color: #F1F5F9; /* майже білий текст */
    --btn-third-color: #0C151D;
    --theme-ab-color: #FFFFFF;
    --border-primary-color: #F1F2F4;
    --text-primary-color: #F1F2F4;
    --text-secondary-color: #CBD5E1; /* світліший сірий */
        --text-third-color: #FBD144;

    --primary-color: #F1F2F4;
    --secondary-color: #A3ABB2;
    --text-color: #E2E8F0; /* майже білий для основного тексту */
        --bg-color: #0F1724;  /* трохи світліший, але все ще темний */
        --bg-third-color: #171F26;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --tooltip-color: #3D3D3D;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    overflow-x: hidden;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    line-height: 1.66;
    font-weight: 400;
    color: var(--text-secondary-color);
    background-color: var(--bg-color);
}
header {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 0;
}
main {
    max-width: 1440px ;
    margin: 0 auto;
}
ul, ol {
    list-style: none;
}
a {
    text-decoration: none;
    color: inherit;
}
img {
    display: block;
    max-width: 100%;
    height: auto;
}
button, input, textarea, select {
    font: inherit;
    border: none;
    outline: none;
}
button {
    background: transparent;
    cursor: pointer;
}



/* ---------- HEADER ---------- */

.header-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    padding: 0 16px;
}
.theme-container {
    display: flex;
    justify-content: center;
}
.toggle-container {
    position: relative;
}
.toggle-container::before,
.toggle-container::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 1px;
    background: var(--theme-ab-color); 
    top: 50%;
    transform: translateY(-50%);   
}
.toggle-container::before {
    left: calc(50% - 80px);
}
.toggle-container::after {
    left: calc(50% + 30px);
}
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-bg-color);
    color: var(--theme-icon-color);
    box-shadow: var(--shadow);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    z-index: 1000;
    transition: all 0.3s;
    
}
.theme-toggle:hover {
    background: var(--theme-bg-hover-color);
    transition: all 0.3s;
}
.header-links {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.contact-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}    
.contact-item {
    position: relative;
}    
.contact-link {
    color: var(--icons-secondary-color);
    font-size: 1.5rem;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}    
.contact-link:hover {
    color: var(--icons-primary-color);
    transform: translateY(-3px);
}    
.contact-tooltip {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    font-weight: 400;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}
.contact-link:hover .contact-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -30px;
}
.social-link:hover .contact-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -20px;
}

.social-links {
    display: flex;
    right: 30px;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.social-link {
    color: var(--icons-secondary-color);
    font-size: 1.5rem;
    transition: color 0.2s, transform 0.2s;
}
.social-link:hover {
    color: var(--icons-primary-color);
    transform: translateY(-3px);
}

.social-link:hover .fab {
    text-shadow: 0 0 30px var(--color);
}

/* ----------- MAIN ---------- */

/* Profile section */
.profile {
    padding: 50px 0;
    border-top: 1px solid #A3ABB2;
}
.profile-container {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
/* All info container */
.profile-developer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
/* Photo Name container */
.profile-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.profile-image {
    width: 200px;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    border: 5px solid var(--border-color);
    box-shadow: var(--shadow);
}
.profile-title h1 {
    font-size: 32px;
    color: var(--text-primary-color);    
}

/* About container */
.about-content {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    flex: 1;
}
.about-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary-color);  
}
.about-text {
    text-align: justify;
    margin-bottom: 15px;
}
.about-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: start;
}

/* Buttons container */
.action-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}
.button {
    width: 100%;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s;
    background-color: var(--btn-primary-color);
    color: var(--btn-text-color);
    box-shadow: var(--shadow);
}
.button:hover {
    background-color: var(--btn-secondary-color);
    transform: translateY(-2px);
    color: var(--btn-text-hover);
}
.button-secondary {
    background-color: var(--btn-secondary-color);
    color: var(--btn-text-hover);
}
.button-secondary i {
    margin-left: 10px;
}

/* Tech container */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: var(--btn-primary-color);
    border-radius: 16px;
    padding: 20px 20px;
    box-shadow: var(--shadow-md);
    width: fit-content;
}
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: default;
}
.tech-item i {
    font-size: 2rem;
    color: var(--icon-secondary);
    transition: all 0.2s ease;
}
.tech-item:hover i {
    color: var(--icon-hover);
    transform: translateY(-3px);
}
.tech-name {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}


/* Jobs section */
.portfolio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 0;
}
.portfolio-container {
    display: flex;
    padding: 0 16px;
    animation: fadeIn 0.5s ease-in-out;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}
.portfolio-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.portfolio-item:hover {
    transform: translateY(-5px);
}
.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-info {
    padding: 20px;
}
.portfolio-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}
.portfolio-description {
    margin-bottom: 15px;
}
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
    text-align: center;
}
.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}
.portfolio-link-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    text-decoration: none;
    transition: all 0.3s;
}
.portfolio-link-btn:hover {
    background-color: var(--bg-color);
    transform: scale(1.1);
}





.footer {
    max-width: 1440px;
    margin: 0 auto;
    padding: 30px 0;
    border-top: 1px solid #A3ABB2;
}
.footer__container {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.footer__container p {
    font-size: 14px;
}


/* Модальне вікно відправки форми */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-container {
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-container {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #FFF;
}
.modal-content {
    padding: 30px;
}

/* Form styles */
.form-title {
    margin-bottom: 20px;
    color: var(--text-primary-color);
    font-size: 1.5rem;
    text-align: center;
    border-bottom: 1px solid black;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary-color);
    font-weight: 500;
}
.form-control {
    
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-control:focus {
    border-color: #555555;
    outline: none;
}
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}
.submit-btn {
    background-color: var(--btn-modal-color);
    color: var(--btn-text-hover);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}
.submit-btn:hover {
    background-color: var(--btn-secondary-color);
    color: var(--btn-text-hover);
}

/* Name fields in one row */
.name-fields {
    display: flex;
    gap: 15px;
}
.name-fields .form-group {
    flex: 1;
}

/* Кастомне сповіщення */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.custom-notification:hover {
    transform: translateY(-2px);
}
.custom-notification.notification-success {
    background-color: #10b981;
}
.custom-notification.notification-error {
    background-color: #ef4444;
}
.custom-notification.notification-info {
    background-color: #3b82f6;
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
.custom-notification.hide {
    animation: slideOutRight 0.3s ease forwards;
}



/* ============================================
    BUTTON LOADING STATE
   ============================================ */

.submit-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to {transform: translateY(-50%) rotate(360deg);}
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


@media (min-width: 450px) {
    .header-links {
        flex-direction: row;
        justify-content: space-around;
    }
    .action-buttons {
        flex-direction: row;
    }
    .button {
        width: fit-content;
    }
}

@media (min-width: 768px)  {
    .profile-container, 
    .header-container, 
    .tab-container,
    .footer__container {
        padding: 0 40px;
    }
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
    .theme-container {
        padding: 0 40px;
    }
    .header-links {
        gap: 50px;
    }
    .contact-links {
        gap: 20px;
    }
    
    
    .profile-title {
        flex-direction: row;
        justify-content: start;
    }
    .tech-stack {
    }
    
    .footer__container {
        flex-direction: row;
        justify-content: space-between;
    }
}
@media (min-width: 992px)  {
    .profile-title {
        flex-direction: column;
    }
    .profile-developer {
        flex-direction: row;
    }
}
@media (min-width: 1199px) {
    .profile-container, 
    .header-container, 
    .tab-container,
    .footer__container {
        padding: 0 60px;
    }
    .profile-developer {
        gap: 60px;
    }
}
@media (min-width: 1440px) {
    .profile-container, 
    .header-container, 
    .tab-container,
    .footer__container {
        padding: 0 80px;
    }
}

.scroll-top {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 15px;
    background: #ffffff;
    color: var(--btn-text-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: var(--shadow);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-3px);
    background: var(--text-accent, #FBD144);
}


.clock-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Courier New', monospace;
}

.clock-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--text-accent);
}

.clock-icon {
    color: var(--text-accent);
    font-size: 1.2rem;
}

.clock-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.clock-separator {
    color: var(--text-accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.clock-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    border-left: 1px solid var(--border-light);
    padding-left: 12px;
    margin-left: 4px;
}