:root {
    --primary-color: #3F51B5; /* MDUI indigo */
    --secondary-color: #E91E63; /* MDUI pink */
    --accent-color: #FF4081; /* MDUI pink accent */
    --bg-color: #ffffff;
    --text-color: #333333;
    --hover-color: #f5f5f5;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: #3F51B5;
    --navbar-text: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #5C6BC0; /* MDUI indigo lighten */
    --secondary-color: #EC407A; /* MDUI pink lighten */
    --accent-color: #FF80AB; /* MDUI pink accent lighten */
    --bg-color: #121212;
    --text-color: #ffffff;
    --hover-color: #2c3034;
    --border-color: #333333;
    --card-bg: #1e1e1e;
    --shadow-color: rgba(255, 255, 255, 0.05);
    --navbar-bg: #303F9F; /* MDUI indigo darken */
    --navbar-text: #ffffff;
}

body {
    font-family: Roboto, sans-serif; /* MDUI uses Roboto */
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* MDUI Toolbar customization */
.mdui-toolbar {
    height: 64px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Image preview overlay */
.image-previewable {
    cursor: zoom-in;
}

body.image-preview-open {
    overflow: hidden;
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2000;
    padding: 24px;
}

.image-preview-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.image-preview-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(960px, 94vw);
    max-height: calc(100vh - 48px);
    padding: 24px 32px 32px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.image-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-preview-close:hover,
.image-preview-close:focus {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
    outline: none;
}

.image-preview-counter {
    color: #f1f1f1;
    font-size: 14px;
    align-self: flex-end;
    margin-right: 56px;
    margin-top: 8px;
}

.image-preview-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.image-preview-nav {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 26px;
    cursor: pointer;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.image-preview-nav:hover,
.image-preview-nav:focus {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
    outline: none;
}

.image-preview-nav[disabled] {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.image-preview-wrapper {
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.image-preview-target {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    background: #000;
}

.image-preview-caption {
    color: #f1f1f1;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

.image-preview-thumbnails {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    padding: 8px 4px 0;
}

.image-preview-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.image-preview-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.image-preview-thumb {
    width: 78px;
    height: 78px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.image-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.image-preview-thumb:hover,
.image-preview-thumb:focus {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
}

.image-preview-thumb.active {
    border-color: var(--primary-color, #3F51B5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .image-preview-panel {
        width: 100vw;
        max-height: 100vh;
        padding: 16px;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.4);
    }

    .image-preview-counter {
        margin-right: 0;
        align-self: center;
    }

    .image-preview-stage {
        gap: 12px;
    }

    .image-preview-nav {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .image-preview-wrapper {
        max-height: 60vh;
    }

    .image-preview-target {
        max-height: 60vh;
    }

    .image-preview-thumbnails {
        gap: 6px;
    }

    .image-preview-thumb {
        width: 60px;
        height: 60px;
    }
}

.mdui-toolbar .mdui-btn-icon {
    /* width: 40px; */
    /* height: 40px; */
    margin-left: 8px;
    transition: all 0.3s ease;
}

.mdui-toolbar .mdui-btn-icon:hover {
    /* background-color: rgba(255, 255, 255, 0.1); */
    /* transform: translateY(-2px); */
}

/* Drawer customization */
.mdui-drawer {
    background-color: var(--card-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-color);
}

.mdui-drawer .mdui-list-item {
    border-radius: 0 28px 28px 0;
    margin-right: 10px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mdui-drawer .mdui-list-item.mdui-list-item-active {
    background-color: rgba(63, 81, 181, 0.15);
    color: var(--primary-color);
}

.mdui-drawer .mdui-list-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.mdui-list-item-icon {
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.mdui-drawer .mdui-list-item:hover .mdui-list-item-icon {
    transform: scale(1.2);
}

/* Page sections */
section {
    padding-top: 80px;
    margin-top: -56px; /* Offset for fixed header */
    scroll-margin-top: 70px; /* Modern browsers */
    transition: all 0.6s ease-out;
    opacity: 0;
    transform: translateY(20px);
    margin-bottom: 3rem;
}

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

/* Add these new styles for enhanced interest buttons */
.interest-card {
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(145deg, #ffffff, #f7f7f7);
    position: relative;
    overflow: hidden;
}

.interest-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 50%;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    /* transform: rotate(45deg); */
    pointer-events: none;
}

.interest-card:hover::before {
    /* top: 150%; */
    /* left: 150%; */
}

.interest-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.interest-icon {
    font-size: 48px !important;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.interest-card:hover .interest-icon {
    transform: scale(1.2);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Avatar animation and styling */
.avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 3px;
    transition: all 0.5s ease;
    box-shadow: 0 0 20px var(--shadow-color);
    object-fit: cover;
}

/* Card styling */
.mdui-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px var(--shadow-color);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 30px;
    background-color: var(--card-bg);
}

.mdui-card:hover {
    /* transform: translateY(-8px); */
    box-shadow: 0 12px 28px var(--shadow-color);
}

/* MDUI Typography enhancements */
.mdui-typo-display-2 {
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.mdui-typo-headline {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 16px;
}

/* Social links and buttons */
.social-links {
  display: flex;
  align-items: center;
  justify-content: center; /* Thêm căn giữa theo chiều ngang */
  gap: 15px;
  margin-top: 20px;
  width: 100%; /* Đảm bảo chiếm toàn bộ chiều rộng của container */
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center; /* Căn giữa nội dung trong nút */
  padding: 8px 15px;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  transition: all 0.3s ease;
  background-color: #f5f5f5;
  min-width: 120px; /* Đặt chiều rộng tối thiểu để các nút đồng đều */
}

.social-links a:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.social-links i {
  margin-right: 8px; /* Khoảng cách giữa icon và text */
}

/* Footer social links - Redesigned */
.footer-social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 25px 0;
}

.footer-social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.footer-social-links .github {
  color: #fff;
  background-color: #24292e;
  border: 1px solid #24292e;
}

.footer-social-links .email {
  color: #fff;
  background-color: #ea4335;
  border: 1px solid #ea4335;
}

.footer-social-links a:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  z-index: -1;
  transition: width 0.3s ease;
}

.footer-social-links a:hover:before {
  width: 100%;
}

.footer-social-links a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.footer-social-links i {
  margin-right: 10px;
  font-size: 18px;
}

/* Animation on hover */
.footer-social-links a:hover i {
  animation: bounce 0.6s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

/* Updated theme switch button */
#theme-switch {
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

#theme-switch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#theme-switch:hover::after {
    opacity: 1;
}

/* MDUI specific dark theme overrides */
.mdui-theme-layout-dark .interest-card {
    background-color: var(--card-bg);
    background: linear-gradient(145deg, #1e1e1e, #181818);
    transition: 0.2s;
}

.mdui-theme-layout-dark .mdui-card {
    background-color: var(--card-bg);
}

.mdui-theme-layout-dark .mdui-drawer {
    background-color: #1a1a1a;
}

.mdui-theme-layout-dark .mdui-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mdui-theme-layout-dark .mdui-list-item.mdui-list-item-active {
    background-color: rgba(92, 107, 192, 0.15);
}

/* Scroll to top button with MDUI styles */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
    height: 56px;
    width: 56px;
    transform: scale(0);
    border-radius: 50%;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#back-to-top::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#back-to-top:hover::after {
    opacity: 1;
}

#back-to-top.visible {
    opacity: 1;
    transform: scale(1);
    animation: bounce 2s infinite;
}

#back-to-top i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    line-height: normal;
    font-size: 24px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-8px) scale(1.05);
    }
    60% {
        transform: translateY(-4px) scale(1.03);
    }
}

/* Hover effect for list items */
.hover-effect {
    transition: all 0.3s ease;
    transform: translateX(0);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

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

.hover-effect:hover {
    background-color: var(--hover-color) !important;
    transform: translateX(10px);
    box-shadow: 0 3px 12px var(--shadow-color);
}

.hover-effect:hover::after {
    left: 100%;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px; /* Account for fixed header */
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #666;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #666;border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #888;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Typing animation for dynamic text */
.typing-text::after {
    content: '|';
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* Card content fade in effect */
.mdui-card {
    position: relative;
}

.mdui-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mask-image: linear-gradient(transparent, black, transparent);
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateY(-100%);
    transition: all 0.7s ease;
}

.mdui-card:hover::before {
    transform: translateY(100%);
}

/* Dark mode transition */
.theme-transition {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.theme-transition * {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Section heading animations */
h2 {
    position: relative;
    overflow: hidden;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
}

h2:hover::after {
    width: 100px;
}

/* Make sure Material-UI icons are properly sized */
.mdui-icon.material-icons {
    font-size: 24px;
    line-height: 1;
}

/* Add 3D text effect to main heading */
.mdui-typo-display-2 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* MDUI appbar shadow enhancement */
.mdui-appbar {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* MDUI FAB button pulse animation */
@keyframes mdui-fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 64, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0);
    }
}

.mdui-fab:not(:active):hover {
    animation: mdui-fab-pulse 1.5s infinite;
}

/* Image link hover effects */
a img {
    transition: all 0.3s ease;
    filter: grayscale(0);
}

a:hover img {
    filter: grayscale(30%);
    transform: scale(1.05);
}

/* MDUI tooltip enhancement */
.mdui-tooltip {
    font-size: 14px;
    /* background-color: var(--primary-color); */
    border-radius: 4px;
    padding: 6px 12px;
}

/* Fix social icons alignment in footer across all screen sizes */
.social-icons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

.social-icons a i {
    font-size: 20px;
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
}
/* Hide navigation buttons on mobile and only show menu icon */
@media (max-width: 768px) {
    .mobile-menu {
        display: flex !important;
        position: absolute;
        right: 8px;
    }
    
    /* Center logo on mobile */
    .mdui-toolbar .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Fix mobile menu button position */
    .mobile-menu {
        position: absolute;
        right: 8px;
    }

    /* Bigger touch targets on mobile */
    .mdui-btn-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }
    
    /* Better card spacing on mobile */
    .mdui-card {
        margin: 15px 0;
        border-radius: 12px;
    }
    
    /* Improved container padding */
    .mdui-container {
        padding: 0 16px;
    }
    
    /* Better typography on mobile */
    .mdui-typo-display-2 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .mdui-typo-headline {
        font-size: 1.4rem;
        line-height: 1.4;
    }
    
    .mdui-typo-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    /* Improved button spacing */
    .mdui-btn {
        margin: 4px;
        min-width: 88px;
    }
    
    /* Better form elements */
    .mdui-textfield {
        margin-bottom: 20px;
    }
    
    .mdui-textfield-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    /* Improved grid spacing */
    .mdui-row {
        margin: 0 -8px;
    }
    
    .mdui-col-xs-12 {
        padding: 0 8px;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    /* Fix social icons alignment in footer */
    .social-icons {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .social-icons a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.1);
        margin: 0;
        transition: all 0.3s ease;
    }
    
    .social-icons a:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    /* Adjust avatar size on mobile */
    .avatar img {
        width: 120px;
        height: 120px;
    }
    
    /* Make interest cards more compact on mobile */
    .interest-card {
        height: 120px;
        margin-bottom: 15px;
    }
    
    .interest-icon {
        font-size: 36px !important;
    }
    
    /* Adjust padding for sections on mobile */
    section {
        padding-top: 70px;
        margin-bottom: 2rem;
    }
    
    /* Better button spacing on mobile */
    .social-links a {
        width: 100%;
        max-width: 280px;
        margin: 0 !important;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Enhanced mobile navigation */
    .mdui-toolbar {
        padding: 0 8px;
    }
    
    .mdui-toolbar-spacer {
        min-width: 0;
    }
    
    /* Better mobile cards */
    .mdui-card-content {
        padding: 20px 16px;
    }
    
    .mdui-card-header {
        padding: 16px;
    }
    
    /* Improved mobile forms */
    .mdui-dialog {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    /* Better mobile tables */
    .mdui-table-fluid {
        font-size: 14px;
    }
    
    .mdui-table th,
    .mdui-table td {
        padding: 8px 12px;
    }
}

/* Tablet specific improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .mdui-container {
        padding: 0 24px;
    }
    
    .mdui-card {
        margin: 20px 0;
    }
    
    .interest-card {
        height: 130px;
    }
    
    .interest-icon {
        font-size: 42px !important;
    }
    
    .avatar img {
        width: 140px;
        height: 140px;
    }
    
    .social-links {
        gap: 20px;
    }
    
    .social-links a {
        min-width: 140px;
        padding: 10px 20px;
    }
}

/* Large screen improvements */
@media (min-width: 1200px) {
    .mdui-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .interest-card {
        height: 160px;
    }
    
    .interest-icon {
        font-size: 56px !important;
    }
    
    .avatar img {
        width: 180px;
        height: 180px;
    }
    
    .mdui-typo-display-2 {
        font-size: 3.5rem;
    }
    
    .social-links {
        gap: 30px;
    }
    
    .social-links a {
        min-width: 160px;
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* Print styles */
@media print {
    .mdui-appbar,
    .mdui-drawer,
    .social-links,
    .social-icons,
    #back-to-top,
    .mdui-fab,
    .floating-shapes {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .mdui-card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .post-title {
        font-size: 24pt;
        font-weight: bold;
        margin-bottom: 12pt;
    }
    
    .post-meta {
        font-size: 10pt;
        color: #666;
        margin-bottom: 12pt;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .floating-shapes {
        display: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --secondary-color: #ff0000;
        --text-color: #000000;
        --bg-color: #ffffff;
        --border-color: #000000;
    }
    
    .mdui-card {
        border: 2px solid var(--border-color);
    }
    
    .mdui-btn {
        border: 2px solid var(--border-color);
    }
    
    a {
        text-decoration: underline;
        font-weight: bold;
    }
}

/* Focus improvements for keyboard navigation */
.mdui-btn:focus,
.mdui-btn-icon:focus,
.mdui-textfield-input:focus,
a:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Enhanced card hover effects */
.mdui-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mdui-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

/* Better loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Enhanced error states */
.error-message {
    border-left: 4px solid #f44336;
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.success-message {
    border-left: 4px solid #4caf50;
    background: #e8f5e8;
    color: #2e7d32;
    padding: 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.warning-message {
    border-left: 4px solid #ff9800;
    background: #fff3e0;
    color: #e65100;
    padding: 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.info-message {
    border-left: 4px solid #2196f3;
    background: #e3f2fd;
    color: #1565c0;
    padding: 16px;
    margin: 16px 0;
    border-radius: 4px;
}

/* Enhanced form validation */
.mdui-textfield-invalid .mdui-textfield-input {
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.mdui-textfield-invalid .mdui-textfield-label {
    color: #f44336;
}

.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Enhanced tooltips */
.mdui-tooltip {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
}

/* Better image handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-responsive {
    width: 100%;
    height: auto;
}

.img-circle {
    border-radius: 50%;
}

.img-thumbnail {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-row {
    flex-direction: row !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.m-0 { margin: 0 !important; }
.m-1 { margin: 8px !important; }
.m-2 { margin: 16px !important; }
.m-3 { margin: 24px !important; }
.m-4 { margin: 32px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 8px !important; }
.pb-2 { padding-bottom: 16px !important; }
.pb-3 { padding-bottom: 24px !important; }
.pb-4 { padding-bottom: 32px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 8px !important; }
.pt-2 { padding-top: 16px !important; }
.pt-3 { padding-top: 24px !important; }
.pt-4 { padding-top: 32px !important; }

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    /* Remove the backdrop-filter blur that's causing visibility issues */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile header logo centering */
@media (max-width: 1024px) {
    .mdui-toolbar {
        display: flex;
        align-items: center;
        position: relative;
        justify-content: space-between;
    }
    
    .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
    
    .logo-container a {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mdui-toolbar-spacer {
        display: none;
    }
    
    .mdui-toolbar > .mdui-btn-icon {
        z-index: 2;
    }
}

/* Ensure menu button and home button are properly positioned */
@media (max-width: 1024px) {
    .mdui-toolbar > .mdui-btn-icon:first-child {
        margin-right: auto;
    }
    
    .mdui-toolbar > .mdui-btn-icon:last-child {
        margin-left: auto;
    }
}