/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Custom utility classes */
/* Line clamping utilities moved to public_profiles.css */

/* Sortable animation classes */
.sortable-ghost {
    opacity: 0.4;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    transform: rotate(5deg);
}

.sortable-drag {
    transform: rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.sortable-chosen {
    transform: scale(1.02);
}

.sortable-fallback {
    display: none;
}

.dragging {
    z-index: 999;
    transform: rotate(5deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.sorting-active .sorting-inactive {
    opacity: 0.6;
    transform: scale(0.98);
}

.drop-target {
    background-color: #eff6ff;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.show-drop-zones [data-sortable-item] {
    border: 2px dashed transparent;
    transition: all 0.2s ease;
}

.show-drop-zones [data-sortable-item]:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.updating-order {
    pointer-events: none;
    opacity: 0.7;
}

.updating-order::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.1) 50%, transparent 100%);
    animation: loading-sweep 1.5s infinite;
}

@keyframes loading-sweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Form loading states */
.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.loading:hover {
    transform: none !important;
}

/* Form section animations */
.form-section {
    transition: all 0.3s ease-out;
}

/* Button loading animation */
.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: button-loading 1.5s infinite;
}

@keyframes button-loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Image upload animations */
.image-upload-zone {
    transition: all 0.3s ease-out;
}

.image-upload-zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-preview-enter {
    animation: imagePreviewEnter 0.4s ease-out;
}

@keyframes imagePreviewEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Error and success states */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.success-pulse {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Blog and Markdown Styles */
.markdown-content {
    line-height: 1.7;
    color: #334155;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-content h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.markdown-content h3 {
    font-size: 1.5rem;
}

.markdown-content h4 {
    font-size: 1.25rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content blockquote {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    color: #334155;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
}

.markdown-content th {
    background-color: #f9fafb;
    font-weight: 600;
}

.markdown-content tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Code Blocks and Syntax Highlighting */
.code-block {
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #374151;
    border-bottom: 1px solid #4b5563;
}

.language-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: #4b5563;
    color: #d1d5db;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #6b7280;
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background-color: #1f2937;
    color: #e5e7eb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Inline code */
.markdown-content code {
    background-color: #f0fdf4;
    color: #5b21b6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Rouge syntax highlighting */
.highlight {
    background-color: #1f2937;
    color: #e5e7eb;
}

.highlight .c {
    color: #6b7280;
}

/* Comment */
.highlight .k {
    color: #8b5cf6;
    font-weight: bold;
}

/* Keyword */
.highlight .s {
    color: #10b981;
}

/* String */
.highlight .n {
    color: #e5e7eb;
}

/* Name */
.highlight .nf {
    color: #3b82f6;
}

/* Name.Function */
.highlight .nc {
    color: #f59e0b;
    font-weight: bold;
}

/* Name.Class */
.highlight .m {
    color: #f97316;
}

/* Number */
.highlight .o {
    color: #ef4444;
}

/* Operator */
.highlight .p {
    color: #d1d5db;
}

/* Punctuation */
.highlight .kd {
    color: #8b5cf6;
    font-weight: bold;
}

/* Keyword.Declaration */
.highlight .kt {
    color: #f59e0b;
}

/* Keyword.Type */
.highlight .na {
    color: #3b82f6;
}

/* Name.Attribute */
.highlight .s2 {
    color: #10b981;
}

/* String.Double */
.highlight .si {
    color: #f97316;
}

/* String.Interpol */
.highlight .se {
    color: #f97316;
}

/* Simple syntax highlighting for JavaScript client-side */
span.keyword {
    color: #8b5cf6;
    font-weight: 600;
}

span.string {
    color: #10b981;
}

span.comment {
    color: #6b7280;
    font-style: italic;
}

/* String.Escape */

/* Header anchor links */
.header-link {
    text-decoration: none;
    color: inherit;
    position: relative;
}

.header-link:hover::after {
    content: "#";
    position: absolute;
    left: -1.5rem;
    color: #3b82f6;
    font-weight: normal;
}

/* Table of Contents */
.table-of-contents {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

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

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

.toc-level-1 {
    margin-left: 0;
}

.toc-level-2 {
    margin-left: 1rem;
}

.toc-level-3 {
    margin-left: 2rem;
}

.toc-level-4 {
    margin-left: 3rem;
}

.toc-level-5 {
    margin-left: 4rem;
}

.toc-level-6 {
    margin-left: 5rem;
}

.toc-link {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.toc-link:hover {
    color: #3b82f6;
}

/* Blog post meta */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}

.reading-time::before {
    content: "📖";
    margin-right: 0.25rem;
}

.word-count::before {
    content: "📊";
    margin-right: 0.25rem;
}

/* Blog excerpt */
.blog-excerpt {
    color: #6b7280;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 0.25rem;
}

/* Public Profile Enhancements */

/* Improved gradient animations */
.gradient-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced card hover effects */
.card-hover {
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card-hover:hover::before {
    left: 100%;
}

/* Floating animation for avatar */
.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Pulse animation for status indicators */
.pulse-green {
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Enhanced focus states for accessibility */
.focus-enhanced:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

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

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Enhanced button interactions */
.btn-enhanced {
    position: relative;
    overflow: hidden;
}

.btn-enhanced::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enhanced:active::after {
    width: 300px;
    height: 300px;
}

/* Improved text selection */
::selection {
    background-color: #3B82F6;
    color: white;
}

.dark ::selection {
    background-color: #60A5FA;
    color: #1e293b;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid currentColor;
    }

    .btn-enhanced {
        border: 2px solid currentColor;
    }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
    }

    .mobile-full-width {
        width: 100%;
    }

    .mobile-center {
        text-align: center;
    }
}

/* Loading state animations */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* ==========================================================================
   COMPONENT STYLESHEETS
   ========================================================================== */

/* Public Profiles Styles */
/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.animate-fade-in {
    animation: fade-in 0.6s ease-out;
}

/* Line clamping utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   STAGGERED ANIMATIONS
   ========================================================================== */

/* Staggered animation for grid items */
.grid>div {
    animation: fade-in 0.6s ease-out forwards;
    opacity: 0;
}

/* Animation delays for staggered effect */
.grid>div:nth-child(1) {
    animation-delay: 0ms;
}

.grid>div:nth-child(2) {
    animation-delay: 100ms;
}

.grid>div:nth-child(3) {
    animation-delay: 200ms;
}

.grid>div:nth-child(4) {
    animation-delay: 300ms;
}

.grid>div:nth-child(5) {
    animation-delay: 400ms;
}

.grid>div:nth-child(6) {
    animation-delay: 500ms;
}

/* ==========================================================================
   RESPONSIVE ANIMATIONS
   ========================================================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .animate-fade-in,
    .grid>div {
        animation: none;
        opacity: 1;
    }
}

/* ==========================================================================
   COMPONENT-SPECIFIC STYLES
   ========================================================================== */

/* Profile cards hover effects */
.profile-card {
    transition: all 0.3s ease-out;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Project cards enhanced animations */
.project-card {
    transition: all 0.5s ease-out;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Blog post cards enhanced animations */
.blog-post-card {
    transition: all 0.5s ease-out;
}

.blog-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {

    .animate-fade-in,
    .grid>div {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .profile-card,
    .project-card,
    .blog-post-card {
        transform: none !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}