/* Custom CSS for Bryan McGuire Website */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: .15em solid #0078D7;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation:
        typing 3.5s steps(40, end),
        blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #0078D7; }
}

/* Button Animations */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 10px 25px rgba(0, 120, 215, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 10px 25px rgba(0, 120, 215, 0.2);
}

/* Navigation Active State */
.nav-link.active {
    color: #0078D7 !important;
    font-weight: 600;
}

/* Counter Animation */
.counter {
    transition: all 0.5s ease;
}

/* Project Card Hover Effects */
.project-card {
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e5e7eb;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #0078D7;
}

.project-card .project-icon {
    transition: all 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.1);
}

/* Skill Progress Bars */
.skill-bar {
    background-color: #f3f2f1;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #0078D7, #00BCF2);
    border-radius: 10px;
    transition: width 2s ease-in-out;
    width: 0;
}

.skill-progress.animate {
    width: var(--progress-width);
}

/* Section Fade In Animation */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Form Styles */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #0078D7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.form-label {
    position: absolute;
    left: 16px;
    top: 12px;
    color: #9ca3af;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -8px;
    left: 12px;
    font-size: 12px;
    color: #0078D7;
    background: white;
    padding: 0 4px;
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid #f3f2f1;
    border-top: 3px solid #0078D7;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Success Animation */
.success-checkmark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    margin-right: 8px;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.success-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #10b981;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .typewriter {
        font-size: 1.5rem;
        letter-spacing: .1em;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #0078D7, #00BCF2);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Parallax Effect */
.parallax {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Industry Color Coding */
.industry-maritime { border-left: 4px solid #1e40af; }
.industry-safety { border-left: 4px solid #dc2626; }
.industry-content { border-left: 4px solid #7c3aed; }
.industry-business { border-left: 4px solid #059669; }
.industry-hr { border-left: 4px solid #ea580c; }
.industry-ai { border-left: 4px solid #0078D7; }
.industry-theatre { border-left: 4px solid #be185d; }
.industry-finance { border-left: 4px solid #10b981; }
.industry-health { border-left: 4px solid #6366f1; }
.industry-marketing { border-left: 4px solid #f59e0b; }

/* ========== Blog Styles ========== */

/* Article content typography */
.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #323130;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #323130;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.prose ul, .prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.prose code {
    background: #f3f2f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.prose pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
    position: relative;
}

.prose pre code.hljs {
    background: none;
    padding: 0;
}


.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Code block button bar */
.code-btn-bar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.prose pre:hover .code-btn-bar {
    opacity: 1;
}

.code-btn {
    background: #3a3a3a;
    color: #d4d4d4;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}

.code-btn:hover {
    background: #505050;
    color: #fff;
}

.code-btn.copied {
    background: #107c10;
    border-color: #107c10;
    color: #fff;
}

/* Explain panel below code block */
.explain-panel {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.explain-panel h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0078D7;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.explain-panel p {
    margin-bottom: 0.5rem;
}

.explain-panel .loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Table of Contents */
.toc-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.toc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toc-toggle h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #323130;
    margin: 0;
}

.toc-toggle .toc-arrow {
    font-size: 0.75rem;
    color: #666;
    transition: transform 0.2s;
}

.toc-toggle.collapsed .toc-arrow {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.toc-list li {
    margin-bottom: 0.4rem;
}

.toc-list a {
    color: #0078D7;
    text-decoration: none;
    font-size: 0.85rem;
}

.toc-list a:hover {
    text-decoration: underline;
}

.toc-list .toc-h3 {
    padding-left: 1rem;
}

.prose blockquote {
    border-left: 4px solid #0078D7;
    padding-left: 1rem;
    color: #666;
    font-style: italic;
    margin: 1rem 0;
}

.prose a {
    color: #0078D7;
    text-decoration: underline;
}

.prose a:hover {
    color: #005A9E;
}

.prose img {
    border-radius: 8px;
    margin: 1rem 0;
    max-width: 100%;
}

/* Preview content — stronger selectors to override Tailwind preflight */
.preview-content h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #323130 !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
}

.preview-content h3 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #323130 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
}

.preview-content p {
    margin-bottom: 1rem !important;
    line-height: 1.8 !important;
}

.preview-content ul, .preview-content ol {
    margin-bottom: 1rem !important;
    padding-left: 1.5rem !important;
    list-style-type: disc !important;
}

.preview-content ol {
    list-style-type: decimal !important;
}

.preview-content li {
    margin-bottom: 0.5rem !important;
    line-height: 1.7 !important;
}

.preview-content code {
    background: #f3f2f1 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 0.9em !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

.preview-content pre {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    padding: 1.25rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    white-space: pre !important;
    border: 1px solid #333 !important;
}

.preview-content pre code {
    background: none !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    white-space: pre !important;
}

/* Quill code block format (used when user edits in editor) */
.preview-content .ql-code-block-container,
.preview-content .ql-code-block,
.preview-content .ql-syntax {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    padding: 1.25rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    white-space: pre !important;
    border: 1px solid #333 !important;
}

.preview-content blockquote {
    border-left: 4px solid #0078D7 !important;
    padding-left: 1rem !important;
    color: #666 !important;
    font-style: italic !important;
    margin: 1rem 0 !important;
}

.preview-content a {
    color: #0078D7 !important;
    text-decoration: underline !important;
}

.preview-content strong {
    font-weight: 700 !important;
}

.preview-content em {
    font-style: italic !important;
}

/* Blog card hover */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
}

/* Quill editor overrides for admin */
.ql-editor {
    min-height: 400px;
    font-size: 16px;
    line-height: 1.8;
}

.ql-toolbar {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.ql-container {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}