/* Custom styles for TJ Hlavnice website */

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #991B1B;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Hover effects */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Team colors */
.bg-team-primary {
    background-color: #5f0909ff;
}

.bg-team-secondary {
    background-color: #991B1B;
}

.text-team-primary {
    color: #5f0909ff;
}

.text-team-secondary {
    color: #991B1B;
}

/* Mobile menu animations */
.mobile-menu-enter {
    transform: translateX(-100%);
}

.mobile-menu-enter-active {
    transform: translateX(0);
    transition: transform 0.3s ease-out;
}

.mobile-menu-exit {
    transform: translateX(0);
}

.mobile-menu-exit-active {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in;
}

/* Lightbox styles for gallery */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
}

/* Custom form styles */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: #5f0909ff;
    box-shadow: 0 0 0 2px rgba(95, 9, 9, 0.2);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.btn-primary {
    background-color: #5f0909ff;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #991B1B;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* Table styles */
.standings-table {
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.standings-table th {
    background-color: #5f0909ff;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.standings-table td {
    padding: 0.75rem 1rem;
    white-space: nowrap;
    font-size: 0.875rem;
}

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

.standings-table tr.club-team {
    background-color: #5f0909ff;
    color: white;
    font-weight: bold;
}

/* Loading animation */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5f0909ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* News article content styling */
.news-content {
    line-height: 1.8;
}

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

.news-content h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem 0;
    color: #5f0909ff;
}

.news-content h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1.5rem 0 0.75rem 0;
    color: #5f0909ff;
}

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

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

/* Responsive improvements */
@media (max-width: 768px) {
    .mobile-responsive {
        font-size: 0.875rem;
    }
    
    .mobile-hide {
        display: none;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-full-width {
        width: 100%;
    }
}

/* Rich Text Content Styling */
.prose {
    line-height: 1.6;
}

.prose p {
    margin-bottom: 1rem;
    color: white !important;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: white !important;
}

.prose h1 { font-size: 1.75rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }

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

.prose ul li, .prose ol li {
    margin-bottom: 0.5rem;
    color: white !important;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose blockquote {
    border-left: 4px solid #dc2626;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #d1d5db !important;
}

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

.prose a:hover {
    color: #991b1b;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.prose table th,
.prose table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
    color: white !important;
}

.prose table th {
    background-color: #374151;
    font-weight: bold;
}

.prose strong {
    font-weight: bold;
    color: white !important;
}

.prose em {
    font-style: italic;
    color: white !important;
}

/* Ensure all text content in news articles is white */
.prose * {
    color: white !important;
}

/* Override for specific elements that should maintain their colors */
.prose a {
    color: #dc2626 !important;
}

.prose a:hover {
    color: #991b1b !important;
}

/* CKEditor 5 Dark Theme */
:root {
    /* Helper variables to avoid duplication in the colors. */
    --ck-custom-foreground: hsl(255, 3%, 18%);
    --ck-custom-border: hsl(300, 1%, 22%);
    --ck-custom-white: hsl(0, 0%, 100%);

    /* -- Overrides generic colors. ------------------------------------------------------------- */
    --ck-color-base-foreground: var(--ck-custom-foreground);
    --ck-color-focus-border: hsl(208, 90%, 62%);
    --ck-color-text: hsl(0, 0%, 98%);
    --ck-color-shadow-drop: hsla(0, 0%, 0%, 0.2);
    --ck-color-shadow-inner: hsla(0, 0%, 0%, 0.1);

    /* -- Overrides the default .ck-button class colors. ---------------------------------------- */
    --ck-color-button-default-background: transparent;
    --ck-color-button-default-hover-background: hsl(270, 1%, 22%);
    --ck-color-button-default-active-background: hsl(270, 2%, 20%);
    --ck-color-button-default-active-shadow: hsl(270, 2%, 23%);
    --ck-color-button-default-disabled-background: transparent;

    --ck-color-button-on-background: var(--ck-custom-foreground);
    --ck-color-button-on-hover-background: hsl(255, 4%, 16%);
    --ck-color-button-on-active-background: hsl(255, 4%, 14%);
    --ck-color-button-on-active-shadow: hsl(240, 3%, 19%);
    --ck-color-button-on-disabled-background: var(--ck-custom-foreground);

    --ck-color-button-action-background: hsl(168, 76%, 42%);
    --ck-color-button-action-hover-background: hsl(168, 76%, 38%);
    --ck-color-button-action-active-background: hsl(168, 76%, 36%);
    --ck-color-button-action-active-shadow: hsl(168, 75%, 34%);
    --ck-color-button-action-disabled-background: hsl(168, 76%, 42%);
    --ck-color-button-action-text: var(--ck-custom-white);

    --ck-color-button-save: hsl(120, 100%, 46%);
    --ck-color-button-cancel: hsl(15, 100%, 56%);

    /* -- Overrides the default .ck-dropdown class colors. -------------------------------------- */
    --ck-color-dropdown-panel-background: var(--ck-custom-foreground);
    --ck-color-dropdown-panel-border: var(--ck-custom-foreground);

    /* -- Overrides the default .ck-dialog class colors. ----------------------------------- */
    --ck-color-dialog-background: var(--ck-custom-foreground);
    --ck-color-dialog-form-header-border: var(--ck-custom-border);

    /* -- Overrides the default .ck-splitbutton class colors. ----------------------------------- */
    --ck-color-split-button-hover-background: var(--ck-color-button-default-hover-background);
    --ck-color-split-button-hover-border: var(--ck-custom-foreground);

    /* -- Overrides the default .ck-input class colors. ----------------------------------------- */
    --ck-color-input-background: hsl(255, 4%, 21%);
    --ck-color-input-border: hsl(257, 3%, 43%);
    --ck-color-input-text: hsl(0, 0%, 98%);
    --ck-color-input-disabled-background: hsl(255, 4%, 21%);
    --ck-color-input-disabled-border: hsl(250, 3%, 38%);
    --ck-color-input-disabled-text: hsl(0, 0%, 78%);

    /* -- Overrides the default .ck-labeled-field-view class colors. ---------------------------- */
    --ck-color-labeled-field-label-background: var(--ck-custom-foreground);

    /* -- Overrides the default .ck-list class colors. ------------------------------------------ */
    --ck-color-list-background: var(--ck-custom-foreground);
    --ck-color-list-button-hover-background: var(--ck-custom-foreground);
    --ck-color-list-button-on-background: hsl(208, 88%, 52%);
    --ck-color-list-button-on-background-focus: hsl(208, 88%, 52%);
    --ck-color-list-button-on-text: var(--ck-custom-white);

    /* -- Overrides the default .ck-balloon-panel class colors. --------------------------------- */
    --ck-color-panel-background: var(--ck-custom-foreground);
    --ck-color-panel-border: var(--ck-custom-border);

    /* -- Overrides the default .ck-toolbar class colors. --------------------------------------- */
    --ck-color-toolbar-background: var(--ck-custom-foreground);
    --ck-color-toolbar-border: var(--ck-custom-border);

    /* -- Overrides the default .ck-tooltip class colors. --------------------------------------- */
    --ck-color-tooltip-background: hsl(252, 7%, 14%);
    --ck-color-tooltip-text: hsl(0, 0%, 93%);

    /* -- Overrides the default colors used by the ckeditor5-image package. --------------------- */
    --ck-color-image-caption-background: hsl(0, 0%, 97%);
    --ck-color-image-caption-text: hsl(0, 0%, 20%);

    /* -- Overrides the default colors used by the ckeditor5-widget package. -------------------- */
    --ck-color-widget-blurred-border: hsl(0, 0%, 87%);
    --ck-color-widget-hover-border: hsl(43, 100%, 68%);
    --ck-color-widget-editable-focus-background: var(--ck-custom-white);

    /* -- Overrides the default colors used by the ckeditor5-link package. ---------------------- */
    --ck-color-link-default: hsl(190, 100%, 75%);
}

/* Additional dark theme adjustments for CKEditor 5 */
.ck.ck-editor__main > .ck-editor__editable {
    background: hsl(270, 1%, 29%);
    color: hsl(0, 0%, 98%);
}

.ck.ck-editor__main > .ck-editor__editable.ck-focused {
    background: hsl(270, 1%, 29%);
    border-color: hsl(208, 90%, 62%);
}

/* Improve displaying links in dark theme */
.ck.ck-editor__editable a {
    color: hsl(210, 100%, 63%);
}

/* Improve displaying code blocks in dark theme */
.ck-content pre {
    background: hsl(255, 4%, 21%);
    color: hsl(0, 0%, 91%);
    border-color: hsl(0, 0%, 77%);
}

/* Make sure the editor content area is dark */
.ck.ck-content {
    background: hsl(270, 1%, 29%);
    color: hsl(0, 0%, 98%);
}
