/* ================================================
   MikroTik Training Center Poland - Custom Styles
   Dark Tech Theme with mtik-pl colors
   ================================================ */

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide x-cloak elements until Alpine.js loads */
[x-cloak] {
    display: none !important;
}

/* ===== Selection ===== */
::selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: #e6edf3;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #30363d #0d1117;
}

/* ===== Focus Styles ===== */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== Links ===== */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ===== Buttons ===== */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ===== Images ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Custom Animations ===== */

/* Gradient text animation */
.gradient-text-animated {
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #60a5fa 50%,
        #3b82f6 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Pulse glow effect */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
    }
}

/* Card hover lift */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Magnetic Button Effect ===== */
.magnetic-btn {
    transition: transform 0.2s ease;
}

/* ===== Glass Effect ===== */
.glass {
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(48, 54, 61, 0.5);
}

/* ===== Gradient Border ===== */
.gradient-border {
    position: relative;
    background: #161b22;
    border-radius: 16px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ===== Terminal Style ===== */
.terminal {
    font-family: 'JetBrains Mono', monospace;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
}

.terminal-header {
    background: #161b22;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #30363d;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }

.terminal-body {
    padding: 16px;
    color: #8B949E;
}

.terminal-line {
    margin-bottom: 8px;
}

.terminal-prompt {
    color: #3b82f6;
}

.terminal-command {
    color: #e6edf3;
}

/* ===== Badge Styles ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-accent {
    background: rgba(255, 107, 53, 0.1);
    color: #FF6B35;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 4px;
    background: #30363d;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ===== Tooltip ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #21262d;
    color: #e6edf3;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== Back to Top Button ===== */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #30363d;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Skeleton Loader ===== */
.skeleton {
    background: linear-gradient(
        90deg,
        #21262d 0%,
        #30363d 50%,
        #21262d 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease infinite;
    border-radius: 8px;
}

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

/* ===== Hero Background Pattern ===== */
.hero-pattern {
    background-image:
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(251, 146, 60, 0.05) 0%, transparent 50%);
}

/* ===== Responsive Typography ===== */
@media (max-width: 640px) {
    .text-responsive-xl {
        font-size: 2rem;
    }

    .text-responsive-2xl {
        font-size: 2.5rem;
    }
}

/* ===== Mobile Navigation ===== */
@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(22, 27, 34, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid #30363d;
        padding: 8px 16px;
        z-index: 50;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        color: #8B949E;
        font-size: 10px;
        transition: color 0.2s ease;
    }

    .mobile-nav-item.active,
    .mobile-nav-item:hover {
        color: #7FA6D6;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: black;
    }

    nav, footer, #back-to-top {
        display: none;
    }

    .bg-dark-secondary,
    .bg-dark-tertiary {
        background: #f5f5f5 !important;
    }

    .text-primary {
        color: #2563eb !important;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .border-gray-700 {
        border-color: #8B949E;
    }

    .text-gray-400 {
        color: #C9D1D9;
    }
}

/* ===== Utilities ===== */
.text-balance {
    text-wrap: balance;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Aspect ratios */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Line clamp */
.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;
}

/* ===== Course Card Specific ===== */
.course-difficulty {
    display: flex;
    gap: 2px;
}

.course-difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #30363d;
}

.course-difficulty-dot.active {
    background: #3b82f6;
}

.course-difficulty-dot.active.accent {
    background: #FF6B35;
}

/* ===== Course Badge Colors (Tailwind 400 shades) ===== */
.course-badge-mtcna { background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.05)); border-color: rgba(96, 165, 250, 0.3); }
.course-badge-mtcre { background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.05)); border-color: rgba(52, 211, 153, 0.3); }
.course-badge-mtcse { background: linear-gradient(135deg, rgba(251, 113, 133, 0.2), rgba(251, 113, 133, 0.05)); border-color: rgba(251, 113, 133, 0.3); }
.course-badge-mtctce { background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(192, 132, 252, 0.05)); border-color: rgba(192, 132, 252, 0.3); }
.course-badge-mtcewe { background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(167, 139, 250, 0.05)); border-color: rgba(167, 139, 250, 0.3); }
.course-badge-mtcwe { background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(129, 140, 248, 0.05)); border-color: rgba(129, 140, 248, 0.3); }
.course-badge-mtcine { background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.05)); border-color: rgba(34, 211, 238, 0.3); }
.course-badge-mtcume { background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.05)); border-color: rgba(251, 191, 36, 0.3); }
.course-badge-mtcipv6e { background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(251, 146, 60, 0.05)); border-color: rgba(251, 146, 60, 0.3); }
.course-badge-mtcswe { background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05)); border-color: rgba(148, 163, 184, 0.3); }
