/* ==========================================================================
   DevOps Engineer Resume - Compact Green Terminal Minimalist Design
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root[data-theme="dark"] {
    --bg-main: #0a0e14;
    --bg-card: #111822;
    --bg-card-hover: #192434;
    --bg-secondary: #16202c;
    --border-color: #1e2c3a;
    --border-color-hover: #2e4154;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #10b981;      /* Emerald Green */
    --accent-secondary: #22c55e;    /* Bright Green */
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.12);
    
    --card-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
    --bg-main: #f6f8fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-secondary: #f3f4f6;
    --border-color: #e2e8f0;
    --border-color-hover: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-primary: #059669;      /* Emerald Green */
    --accent-secondary: #16a34a;    /* Green Accent */
    --accent-hover: #047857;
    --accent-light: rgba(5, 150, 105, 0.08);
    
    --card-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.04);
}

/* --- Base & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* --- Monospace / Terminal Typography Class --- */
.font-mono, 
.user-title, 
.section-header h2, 
.job-company, 
.status-badge, 
.contact-label, 
.contact-value, 
.tag, 
.skill-category-title, 
.edu-badge, 
.info-key, 
.terminal-prefix,
code, pre {
    font-family: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent-primary);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateY(0);
    opacity: 1;
}

.toast.hidden {
    transform: translateY(50px);
    opacity: 0;
    pointer-events: none;
}

/* --- Top Navigation Header --- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-main);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.terminal-prefix {
    color: var(--accent-primary);
    margin-right: 4px;
    font-weight: bold;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-icon {
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
}

/* --- Main Layout Wrapper --- */
.page-wrapper {
    padding: 24px 16px 40px 16px;
    max-width: 820px;
    margin: 0 auto;
}

.resume-container.linear-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Hero Section --- */
.hero-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.hero-header {
    display: flex;
    gap: 22px;
    align-items: center;
}

/* --- Squircle (Rounded Square) Avatar --- */
.avatar-container {
    position: relative;
    width: 105px;
    height: 105px;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.status-indicator {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 15px;
    height: 15px;
    background-color: var(--accent-secondary);
    border: 2.5px solid var(--bg-card);
    border-radius: 50%;
}

.hero-bio {
    flex-grow: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-light);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.user-name {
    font-size: 1.95rem;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.user-title {
    font-size: 1.05rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Green filled dot before Senior DevOps Engineer */
.title-dot {
    color: var(--accent-primary);
    margin-right: 8px;
    font-size: 0.9em;
    line-height: 1;
}

.location-experience {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.location-experience span i {
    color: var(--accent-primary);
    margin-right: 4px;
}

/* --- Contacts Grid --- */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.contact-item > i:first-child {
    font-size: 1rem;
    color: var(--accent-primary);
}

.contact-detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.contact-value {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-icon, .external-icon {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.contact-action-btns {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.external-link-btn {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.contact-item:hover .copy-icon,
.contact-item:hover .external-icon,
.contact-item:hover .external-link-btn {
    color: var(--accent-primary);
}

.external-link-btn:hover {
    color: var(--accent-secondary) !important;
}

/* --- Card Section --- */
.card-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.section-header i {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.section-header h2 {
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--accent-primary);
}

/* --- About Summary --- */
.about-summary {
    border-left: 3px solid var(--accent-primary);
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.summary-text strong {
    color: var(--text-primary);
}

/* --- Timeline (Work Experience) --- */
.timeline {
    position: relative;
    padding-left: 18px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
    break-inside: avoid;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -18px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
}

.timeline-marker.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent-primary);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.job-role {
    font-size: 1.02rem;
    color: var(--text-primary);
}

.job-company {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.00rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* Company Logo Circle Image Frame */
.company-logo-img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%; /* Circular frame */
    border: 1.5px solid var(--accent-primary);
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    background-color: var(--bg-secondary);
}

/* Green Highlight for "Наст. время" */
.present-badge {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.70rem;
    background: var(--accent-light);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: inline-block;
    vertical-align: middle;
}

.job-period {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.job-bullets {
    list-style: none;
    margin-bottom: 10px;
}

.job-bullets li {
    position: relative;
    padding-left: 14px;
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin-bottom: 4px;
}

.job-bullets li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.job-bullets strong {
    color: var(--text-primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.73rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.tag.highlight {
    border-color: rgba(16, 185, 129, 0.4);
    background: var(--accent-light);
    color: var(--accent-primary);
    font-weight: 600;
}

.tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* --- Clean Compact Skills List --- */
.skills-list-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-category-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skill-category-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.skill-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* --- Education Linear List --- */
.education-linear-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edu-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    break-inside: avoid;
}

.edu-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.edu-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 2px;
}

.cert-badge {
    color: var(--accent-secondary);
}

.edu-item h3 {
    font-size: 0.95rem;
    margin-bottom: 1px;
}

.edu-degree {
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.edu-year {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* --- Extra Info Grid --- */
.extra-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-card {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
}

.info-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-key {
    color: var(--accent-primary);
    font-weight: 600;
    min-width: 120px;
    flex-shrink: 0;
}

.info-val {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ==========================================================================
   Responsive & Print Styles
   ========================================================================== */

@media (max-width: 640px) {
    .hero-header {
        flex-direction: column;
        text-align: center;
    }

    .location-experience {
        justify-content: center;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .edu-item {
        flex-direction: column;
        gap: 4px;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-card {
        flex-direction: column;
        gap: 2px;
    }

    .info-key {
        min-width: auto;
    }
}

/* --- Print Stylesheet --- */
@media print {
    @page {
        margin: 0; /* Hides default browser header (URL/title) and footer (date/time) */
    }

    .no-print, .top-nav, .copy-icon, .external-icon {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 9.5pt;
        line-height: 1.4;
        margin: 0;
        padding: 12mm 12mm;
    }

    .page-wrapper {
        padding: 0;
        max-width: 100%;
    }

    .resume-container.linear-layout {
        gap: 10px;
    }

    .hero-section, .card-section {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        color: #000000 !important;
        padding: 12px 16px !important;
        break-inside: avoid;
    }

    .user-name, .user-title, h2, h3, h4 {
        color: #000000 !important;
    }

    .user-title, .job-company, .skill-category-title, .present-badge {
        color: #059669 !important;
    }

    .company-logo {
        background: #e6f4ea !important;
        color: #059669 !important;
        border-color: #a7f3d0 !important;
    }

    .tag {
        border: 1px solid #cbd5e1 !important;
        background: #f1f5f9 !important;
        color: #0f172a !important;
    }

    .tag.highlight {
        background: #e6f4ea !important;
        color: #047857 !important;
        border-color: #a7f3d0 !important;
    }
}
