/* Base theme variables */
:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --overlay-color: rgba(255, 255, 255, 0.275);
    --accent-color: #9a2222;
    --secondary-color: rgba(70, 70, 70, 0.8);
    --skill-bg: rgba(130, 30, 30, 0.08);
    --skill-border: rgba(130, 30, 30, 0.3);
    --transition-time: 0.5s;
    --blur-amount: 50px;
    --glitch-color-1: rgba(154, 34, 34, 0.7);
    --glitch-color-2: rgba(100, 20, 20, 0.7);
    --glitch-shadow-1: #9a2222;
    --glitch-shadow-2: #ce3a3a;
    --wrapper-bg: rgba(255, 255, 255, 0.15);
}

/* Dark mode theme */
.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --overlay-color: #151515;
    --accent-color: rgba(140, 30, 30, 0.9);
    --secondary-color: rgba(120, 120, 120, 0.7);
    --skill-bg: rgba(130, 30, 30, 0.15);
    --skill-border: rgba(130, 30, 30, 0.5);
    --wrapper-bg: #121212;
}

/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100%;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color var(--transition-time), color var(--transition-time);
}

/* Main layout containers */
.content-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    background-color: var(--wrapper-bg);
    transition: background-color var(--transition-time);
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--overlay-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-height: calc(100vh - 4rem);
    height: auto;
    border-radius: 0.5rem;
    border: none;
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    transition: background-color var(--transition-time), border-color var(--transition-time);
}

/* Screen layout */
.content-sections {
    display: grid;
    grid-template-columns: 242px 1fr; /* Just right for "Training & Awards" on one line */
    grid-gap: 2rem;
}

.dark-mode .container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    transition: border-color var(--transition-time);
    grid-column: 1 / -1;
}

/* Header job title and tagline */
.job-title-header {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0.5rem 0;
    font-weight: 600;
}

.tagline {
    font-style: italic;
    color: var(--secondary-color);
    margin: 0.3rem 0 1rem 0;
}

h1 {
    display: block;
    font-size: 3em;
    margin: 0.48em 0;
    font-weight: bold;
    color: var(--accent-color);
    transition: color var(--transition-time);
}

/* Glitch effect for name */
.glitch {
  position: relative;
  margin: 0 auto;
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  color: var(--accent-color);
}

.glitch.active-glitch {
  background: var(--bg-color);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7em;
}

.glitch.active-glitch::before,
.glitch.active-glitch::after {
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  animation-direction: alternate-reverse;
  overflow: hidden;
  position: absolute;
  top: 0;
  clip: rect(0, 900px, 0, 0);
  content: attr(data-text);
  background: var(--bg-color);
  left: 0;
  width: 100%;
}

.glitch.active-glitch::after {
  animation-name: glitch-animation;
  animation-duration: 0.3s;
  left: 4px;
  text-shadow: -1px 0 var(--glitch-shadow-1);
}

.glitch.active-glitch::before {
  animation-name: glitch-animation-2;
  animation-duration: 0.4s;
  left: -4px;
  text-shadow: 1px 0 var(--glitch-shadow-2);
}

/* Glitch animations */
@keyframes glitch-animation {
  0% { clip: rect(42px, 9999px, 44px, 0); }
  5% { clip: rect(12px, 9999px, 59px, 0); }
  10% { clip: rect(48px, 9999px, 29px, 0); }
  15.0% { clip: rect(42px, 9999px, 73px, 0); }
  20% { clip: rect(63px, 9999px, 27px, 0); }
  25% { clip: rect(34px, 9999px, 55px, 0); }
  30.0% { clip: rect(86px, 9999px, 73px, 0); }
  35% { clip: rect(20px, 9999px, 20px, 0); }
  40% { clip: rect(26px, 9999px, 60px, 0); }
  45% { clip: rect(25px, 9999px, 66px, 0); }
  50% { clip: rect(57px, 9999px, 98px, 0); }
  55.0% { clip: rect(5px, 9999px, 46px, 0); }
  60.0% { clip: rect(82px, 9999px, 31px, 0); }
  65% { clip: rect(54px, 9999px, 27px, 0); }
  70% { clip: rect(28px, 9999px, 99px, 0); }
  75% { clip: rect(45px, 9999px, 69px, 0); }
  80% { clip: rect(23px, 9999px, 85px, 0); }
  85.0% { clip: rect(54px, 9999px, 84px, 0); }
  90% { clip: rect(45px, 9999px, 47px, 0); }
  95% { clip: rect(37px, 9999px, 20px, 0); }
  100% { clip: rect(4px, 9999px, 91px, 0); }
}

@keyframes glitch-animation-2 {
  0% { clip: rect(65px, 9999px, 100px, 0); }
  5% { clip: rect(52px, 9999px, 74px, 0); }
  10% { clip: rect(79px, 9999px, 85px, 0); }
  15.0% { clip: rect(75px, 9999px, 5px, 0); }
  20% { clip: rect(67px, 9999px, 61px, 0); }
  25% { clip: rect(14px, 9999px, 79px, 0); }
  30.0% { clip: rect(1px, 9999px, 66px, 0); }
  35% { clip: rect(86px, 9999px, 30px, 0); }
  40% { clip: rect(23px, 9999px, 98px, 0); }
  45% { clip: rect(85px, 9999px, 72px, 0); }
  50% { clip: rect(71px, 9999px, 75px, 0); }
  55.0% { clip: rect(2px, 9999px, 48px, 0); }
  60.0% { clip: rect(30px, 9999px, 16px, 0); }
  65% { clip: rect(59px, 9999px, 50px, 0); }
  70% { clip: rect(41px, 9999px, 62px, 0); }
  75% { clip: rect(2px, 9999px, 82px, 0); }
  80% { clip: rect(47px, 9999px, 73px, 0); }
  85.0% { clip: rect(3px, 9999px, 27px, 0); }
  90% { clip: rect(26px, 9999px, 55px, 0); }
  95% { clip: rect(42px, 9999px, 97px, 0); }
  100% { clip: rect(38px, 9999px, 49px, 0); }
}

/* Section styles */
.section {
    margin-bottom: 2rem;
}

/* Ensure consistent top margins for sections */
.main-sections .section:first-child h2,
.skills-sidebar .section:first-child h2 {
    margin-top: 0; /* Remove top margin for first headings to align them */
}

/* Experience and education items */
.experience-item, .education-item {
    margin-bottom: 1.5rem;
}

.job-title, .degree {
    font-weight: bold;
    font-size: 1.1rem;
}

.company, .school {
    font-style: italic;
}

.dates {
    color: var(--secondary-color);
    font-size: 0.9rem;
    transition: color var(--transition-time);
}

/* Sidebar styling */
.skills-sidebar {
    grid-column: 1;
    /* Removed border-right */
    padding-right: 1rem;
}

.skills-sidebar .section {
    margin-bottom: 1.5rem;
}

/* No extra padding */

/* Make left sidebar headings same size as main content headings */
.skills-sidebar h2 {
    font-size: 1.5rem; /* Same as main headings */
    margin-top: 2rem; /* Adjusted to match main content section h2 */
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent-color);
}

.main-content {
    grid-column: 1 / -1;
}

.main-sections {
    grid-column: 2;
}

/* List styles */
ul.skills, 
ul.sidebar-list {
    padding-left: 1.5rem;
    list-style-type: disc;
    margin-bottom: 1rem;
}

.no-bullets,
.sidebar-list,
.skills {
    list-style-type: none !important;
    padding-left: 0.3rem !important;
}

ul.skills li,
ul.sidebar-list li {
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Training & Awards styling */
.award-name {
    font-weight: 500;
    line-height: 1.3;
}

.award-year {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-top: 0.2rem;
    transition: color var(--transition-time);
}

.skills-sidebar .education-item {
    padding-left: 0.3rem;
    margin-bottom: 0;
}

.skills-sidebar .education-item .degree,
.skills-sidebar .education-item .school,
.skills-sidebar .education-item .dates {
    font-size: 0.95rem;
    line-height: 1.4;
}

ul {
    padding-left: 1.5rem;
    list-style-position: outside;
}

ul.regular-list {
    list-style-position: outside;
    margin-left: 0;
    column-count: 2;
    column-gap: 1.5rem;
}

ul.regular-list li {
    break-inside: avoid;
    margin-bottom: 0.5rem;
}

/* Contact info and links */
.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-info p {
    margin: 0.5rem 1rem;
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-time), opacity 0.3s;
}

.contact-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-time), transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.5s ease;
}

.theme-toggle:focus {
    outline: none;
}

/* Download dropdown */
.download-dropdown {
    position: fixed;
    top: 20px;
    right: 80px;
    z-index: 100;
    display: none; /* Hidden by default */
}

.download-dropdown.show-for-brave {
    display: block;
}

.download-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: background-color var(--transition-time), transform 0.3s ease;
    min-width: 80px;
}

.download-button:hover {
    transform: scale(1.05);
}

.download-button svg {
    width: 16px;
    height: 16px;
    transition: transform 0.5s ease;
}

.dropdown-arrow {
    width: 12px !important;
    height: 12px !important;
    margin-left: 4px;
}

.download-button:focus {
    outline: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    margin-top: 4px;
    display: none;
    z-index: 101;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* Dark mode dropdown */
.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #555;
}

.dark-mode .dropdown-item {
    color: #e0e0e0;
}

.dark-mode .dropdown-item:hover {
    background-color: #3d3d3d;
}

/* Hide print-only elements on screen */
.print-only {
    display: none;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .content-sections {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .download-dropdown {
        right: 60px;
        top: 10px;
    }
    
    .download-button {
        padding: 10px 12px;
        font-size: 10px;
        min-width: 70px;
    }
    
    .download-button svg {
        width: 14px;
        height: 14px;
    }
    
    .dropdown-arrow {
        width: 10px !important;
        height: 10px !important;
    }
    
    ul.regular-list {
        column-count: 1;
    }
    
    .skills-sidebar {
        grid-column: 1;
        border-right: none;
        border-bottom: 1px solid var(--skill-border);
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .main-sections {
        grid-column: 1;
    }
}

/* ATS-Friendly Print Styles */
@media print {
    /* Page setup */
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    /* Force proper page sizing */
    html, body {
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Reset everything to ATS-friendly defaults */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    body, html {
        background: white !important;
        color: black !important;
        font-family: Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Hide decorative elements */
    .theme-toggle,
    .download-dropdown {
        display: none !important;
    }
    
    /* Container adjustments */
    .content-wrapper {
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    
    .container {
        background: white !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Single column layout for ATS */
    .content-sections {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }
    
    .skills-sidebar,
    .main-sections {
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Header styling */
    header {
        text-align: center !important;
        margin-bottom: 0.3in !important;
    }
    
    header h1 {
        font-size: 18pt !important;
        font-weight: bold !important;
        color: #9a2222 !important;
        margin: 0 0 0.1in 0 !important;
        font-family: Arial, sans-serif !important;
        animation: none !important;
        text-shadow: none !important;
    }
    
    header h1 * {
        font-family: Arial, sans-serif !important;
        animation: none !important;
        text-shadow: none !important;
        color: #9a2222 !important;
        font-size: 18pt !important;
        font-weight: bold !important;
    }
    
    header h1 .glitch {
        font-family: Arial, sans-serif !important;
        animation: none !important;
        text-shadow: none !important;
        color: black !important;
        position: static !important;
        font-size: 0 !important;
    }
    
    header h1 .glitch::before,
    header h1 .glitch::after {
        display: none !important;
        content: none !important;
        animation: none !important;
    }
    
    /* Replace glitch text with clean text in print */
    header h1 .glitch::before {
        content: "Tom Ervin" !important;
        font-size: 18pt !important;
        color: #9a2222 !important;
        font-family: Arial, sans-serif !important;
        display: inline !important;
        position: static !important;
        animation: none !important;
        text-shadow: none !important;
        clip: none !important;
        -webkit-clip-path: none !important;
        clip-path: none !important;
    }
    
    /* Job title - hide in print */
    header .job-title-header {
        display: none !important;
    }
    
    /* Hide tagline in print */
    header .tagline {
        display: none !important;
    }
    
    /* Contact info for print */
    .contact-info {
        display: block !important;
        text-align: center !important;
        margin: 0 !important;
    }
    
    .contact-info p {
        display: block !important;
        margin: 0 !important;
        font-size: 11pt !important;
        text-align: center !important;
    }
    
    /* Style the contact links */
    .contact-info a {
        color: black !important;
        text-decoration: none !important;
    }
    
    /* Section headings */
    h2 {
        font-size: 12pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        color: #9a2222 !important;
        margin: 0.25in 0 0.1in 0 !important;
        padding: 0 !important;
        border-bottom: 1pt solid #9a2222 !important;
        font-family: Arial, sans-serif !important;
        animation: none !important;
        text-shadow: none !important;
    }
    
    /* Community Involvement header should display normally */
    
    h2::before,
    h2::after {
        display: none !important;
    }
    
    /* First section has no top margin */
    .main-content .section:first-child h2 {
        margin-top: 0 !important;
    }
    
    /* Experience entries */
    .experience-item {
        margin-bottom: 0.15in !important;
    }
    
    .job-title {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin: 0 !important;
    }
    
    .company {
        font-size: 11pt !important;
        font-style: italic !important;
        margin: 0 !important;
    }
    
    .dates {
        font-size: 10pt !important;
        color: #666 !important;
        margin: 0 0 0.05in 0 !important;
    }
    
    /* Lists */
    ul {
        margin: 0.05in 0 0.1in 0 !important;
        padding-left: 0.2in !important;
    }
    
    li {
        font-size: 10pt !important;
        line-height: 1.3 !important;
        margin-bottom: 0.02in !important;
    }
    
    /* Skills as inline list */
    .skills-sidebar .skills {
        list-style: none !important;
        padding: 0 !important;
        margin: 0.05in 0 0.1in 0 !important;
    }
    
    .skills-sidebar .skills li {
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 0.02in !important;
        font-size: 10pt !important;
        color: black !important;
        font-weight: normal !important;
    }
    
    .skills-sidebar .skills li::after {
        content: "";
    }
    
    .skills-sidebar .skills li:last-child::after {
        content: "";
    }
    
    /* Training & Awards list styling for ATS compatibility */
    .skills-sidebar .sidebar-list li {
        font-size: 10pt !important;
        color: black !important;
        font-weight: normal !important;
        line-height: 1.3 !important;
        margin-bottom: 0.02in !important;
    }
    
    /* ATS-friendly awards formatting - combine name and year on one line */
    .award-name,
    .award-year {
        display: inline !important;
        font-size: 10pt !important;
        color: black !important;
        font-weight: normal !important;
    }
    
    .award-year::before {
        content: " - ";
    }
    
    /* Education formatting - single line for ATS in print only */
    .education-item {
        margin: 0.05in 0 !important;
    }
    
    .education-item .degree,
    .education-item .school,
    .education-item .dates {
        font-size: 10pt !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        display: inline !important;
        font-style: normal !important;
        font-weight: normal !important;
        color: black !important;
    }
    
    .education-item .school::before {
        content: " - ";
    }
    
    .education-item .dates::before {
        content: ", ";
    }
    
    /* Community involvement as simple list */
    .regular-list {
        column-count: 1 !important;
        list-style-position: inside !important;
        margin: 0.05in 0 0.1in 0 !important;
        padding-left: 0.2in !important;
    }
    
    .regular-list li {
        break-inside: avoid !important;
        font-size: 10pt !important;
        color: black !important;
        font-weight: normal !important;
        line-height: 1.3 !important;
        margin-bottom: 0.02in !important;
    }
    
    /* Remove all animations and effects and fix overflow */
    * {
        animation: none !important;
        transition: none !important;
        text-shadow: none !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Ensure content flows properly for multi-page printing */
    .main-content,
    .content-sections,
    .skills-sidebar,
    .main-sections {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        page-break-inside: auto !important;
    }
    
    /* Ensure all sidebar headings are consistent */
    .skills-sidebar h2 {
        font-size: 12pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        color: #9a2222 !important;
        margin: 0.25in 0 0.1in 0 !important;
        padding: 0 !important;
        border-bottom: 1pt solid #9a2222 !important;
        font-family: Arial, sans-serif !important;
    }
}

