/* CMS2 Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #333;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 2px solid #dee2e6;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar h3 {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.menu-home-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.menu-home-link:hover {
    color: #0056b3;
    text-decoration: none;
    transform: translateX(2px);
}

/* Navigation Tree */
.navigation-tree {
    max-height: 60vh;
    overflow-y: auto;
}

.tree-node {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tree-node:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateX(2px);
}

.tree-node strong {
    color: var(--primary-color);
    font-weight: 600;
}

.tree-node a {
    color: #495057;
    transition: color 0.2s ease;
}

.tree-node a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.tree-node a.current-article {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.tree-children {
    border-left: 2px solid #e9ecef;
    margin-left: 15px;
    padding-left: 10px;
}

/* Search Form */
.search-form {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.search-form:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-form .form-control,
.search-form .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Tags */
.tag-link {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    color: #495057;
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.875rem;
    margin: 2px;
    display: inline-block;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.tags-cloud {
    line-height: 2;
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: #0056b3;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

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

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

.article-content code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

/* Article Meta */
.article-meta {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

.article-meta h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Media Styles */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.media-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.media-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.media-thumbnail {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid #e9ecef;
}

.media-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.media-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.media-description strong {
    color: var(--dark-color);
    display: block;
    margin-bottom: 0.25rem;
}

/* Video and Document Thumbnails */
.video-thumbnail,
.document-thumbnail,
.file-thumbnail {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.video-thumbnail:hover,
.document-thumbnail:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.05) 100%);
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-width: 1px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: #0056b3;
}

/* Language Selector */
.language-selector {
    z-index: 1000;
}

.language-selector .form-select {
    border-radius: 6px;
    border-color: var(--primary-color);
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border-width: 1px;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
    border-color: var(--info-color);
    color: #0c5460;
}

/* Modal Styles */
.modal-content {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    color: white;
}

.btn-close {
    filter: invert(1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: relative !important;
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 1rem;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }
}

/* Desktop sidebar width consistency */
@media (min-width: 769px) {
    .sidebar {
        width: 18% !important;
    }
    
    .main-content {
        margin-left: 18% !important;
    }
}
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .media-thumbnail {
        max-height: 150px;
    }
    
    .tree-node {
        padding: 6px 8px;
    }
    
    .search-form {
        margin: 10px 0;
        padding: 1rem;
    }
    
    .article-meta {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .tag-link {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .modal,
    .btn,
    .search-form {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .media-thumbnail {
        max-height: 150px;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Animation for loading states */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Custom scrollbar for webkit browsers */
.navigation-tree::-webkit-scrollbar {
    width: 6px;
}

.navigation-tree::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.navigation-tree::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

.navigation-tree::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Disclaimer/Privacy Notice Styles */
.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.disclaimer-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px;
    animation: slideInUp 0.4s ease;
}

.disclaimer-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.disclaimer-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem;
}

.disclaimer-body {
    padding: 25px;
    line-height: 1.6;
    color: #333;
}

.disclaimer-body p {
    margin-bottom: 15px;
}

.disclaimer-body ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.disclaimer-body li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.disclaimer-note {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 4px;
    font-style: italic;
    margin-top: 20px;
}

.disclaimer-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.disclaimer-footer .btn {
    min-width: 140px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.disclaimer-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.more-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
    line-height: 1.5;
}

.more-info h6 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.more-info p {
    margin-bottom: 10px;
}

.more-info p:last-child {
    margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* Mobile responsiveness for disclaimer */
@media (max-width: 768px) {
    .disclaimer-content {
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .disclaimer-header {
        padding: 15px;
    }
    
    .disclaimer-header h4 {
        font-size: 1.1rem;
    }
    
    .disclaimer-body {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    .disclaimer-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .disclaimer-footer .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 8px;
    }
}