@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    /* Modern color palette */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent-bg: #334155;
    --card-bg: #475569;
    --header-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --sidebar-bg: #1e293b;
    --grid-bg: #0f172a;
    --tile-bg: #ffffff;

    /* Text colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dark: #1e293b;

    /* Accent colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-hover: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:
        0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg:
        0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl:
        0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgb(99 102 241 / 0.3);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    line-height: 1.6;
    max-height: 100vh;
    overflow: hidden;
    background: var(--primary-bg);
    color: var(--text-primary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-bg);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-bg);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

ul,
li {
    list-style: none;
}

p {
    margin: 0.5rem 0;
}

img {
    width: 100%;
    height: auto;
}

h1 {
    font-family: "Inter", sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

button {
    margin: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-lg);
    min-width: 8rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: "Roboto Condensed", sans-serif;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left var(--transition-slow);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Header */
.app-header {
    background: var(--header-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 4vh;
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
    }
}

.app-header .title {
    position: relative;
    z-index: 1;
    animation: slideInFromTop 0.8s ease-out;
    font-family: "Roboto Condensed", sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0;
}

.app-header .description {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
    animation: slideInFromTop 0.8s ease-out 0.2s both;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content */
.content {
    display: flex;
    width: 100vw;
    height: 88vh;
    gap: 0;
}

/* Sidebar container */
aside {
    width: 15vw;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--accent-bg);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Sidebar - Categories */
#categories {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    margin: 0;
}

#categories::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.5;
}

#categories li {
    padding: 1rem 1.25rem;
    margin: 0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: "Roboto Condensed", sans-serif;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 60px;
}

#categories li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
    transform-origin: bottom;
}

#categories li:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    transform: translateX(8px);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

#categories li:hover::before {
    transform: scaleY(1);
}

#categories li.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    font-weight: 600;
}

#categories li.active::before {
    transform: scaleY(1);
}

#categories li p {
    margin: 0;
    padding: 0;
    border-radius: var(--radius-md);
    color: inherit;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: left;
    word-wrap: break-word;
    line-height: 1.4;
}

.bookmarks {
    width: 82vw;
    overflow: auto;
    background: var(--grid-bg);
    position: relative;
}

.bookmarks::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.3;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50vh;
    flex-direction: column;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent-bg);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

#grid {
    margin: 1.5rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
    justify-content: stretch;
    font-family: "Roboto Condensed", sans-serif;
    padding: 0 1rem;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#grid > div {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow:
        0 8px 25px -5px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(99, 102, 241, 0.12);
    animation: slideInCard 0.6s ease-out both;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    min-height: 280px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: "Roboto Condensed", sans-serif;
    backdrop-filter: blur(20px);
    transform-origin: center;
}

#grid > div::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.03) 0%,
        rgba(139, 92, 246, 0.03) 50%,
        rgba(236, 72, 153, 0.03) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

#grid > div:hover::before {
    opacity: 1;
}

#grid > div:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 32px 64px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.9) 100%
    );
}

@keyframes slideInCard {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#grid > div.simple-url {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.25rem;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    font-weight: 400;
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

#grid > div.simple-url::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    transform-origin: left;
}

#grid > div.simple-url:hover::before {
    transform: scaleX(1);
}

#grid div a {
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: 0.3px;
    font-weight: 500;
    font-family: "Roboto Condensed", sans-serif;
    line-height: 1.5;
    word-break: break-word;
    padding: 1rem 0.8rem;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 0.95rem;
    display: block;
    text-align: center;
    overflow: hidden;
}

#grid div a:hover {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.05);
    box-shadow:
        0 16px 32px -8px rgba(99, 102, 241, 0.35),
        0 0 0 1px rgba(99, 102, 241, 0.3);
    border-color: transparent;
    letter-spacing: 0.5px;
    font-weight: 600;
}

#grid > div.twitter-url {
    padding: 0.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 280px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(99, 102, 241, 0.08);
}

/* Tweet container styling */

/* Custom scrollbar for Twitter tweet containers */
#grid > div.twitter-url::-webkit-scrollbar {
    width: 6px;
}

#grid > div.twitter-url::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 3px;
}

#grid > div.twitter-url::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

#grid > div.twitter-url::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Firefox scrollbar styling */
#grid > div.twitter-url {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) rgba(99, 102, 241, 0.05);
}

/* Category Badge Styles */
.category-badge {
    animation: badgeSlideIn 0.5s ease-out;
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

@keyframes badgeSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Enhanced Simple URL Cards */
#grid > div.simple-url {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
}

#grid > div.simple-url::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.8) 0%,
        rgba(139, 92, 246, 0.8) 50%,
        rgba(236, 72, 153, 0.8) 100%
    );
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
    z-index: 10;
}

#grid > div.simple-url:hover::after {
    transform: scaleX(1);
}

#grid > div.simple-url:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1);
}

/* Enhanced Twitter URL Cards */
#grid > div.twitter-url {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
}

#grid > div.twitter-url::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        rgba(29, 161, 242, 0.8) 0%,
        rgba(99, 102, 241, 0.8) 100%
    );
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: right;
    z-index: 10;
}

#grid > div.twitter-url:hover::after {
    transform: scaleX(1);
}

#grid > div.twitter-url:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        0 0 40px rgba(29, 161, 242, 0.1);
}

/* Advanced card styling for enhanced visual appeal */
#grid > div {
    position: relative;
    overflow: hidden;
}

.twitter-tweet {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
}

/* Card loading indicator at bottom */
.card-loading {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.card-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-bg);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.card-loading .loading-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Footer */
.footer {
    width: 100vw;
    height: 12vh;
    background: var(--secondary-bg);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--accent-bg);
    position: relative;
    gap: 2rem;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.3;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-stats {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#page-no {
    color: var(--text-secondary);
    font-weight: 500;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* Search and filter bar */
.search-container {
    padding: 0.8rem 1rem;
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--accent-bg);
    display: flex;
    gap: 0.8rem;
    align-items: center;
    min-height: 60px;
    box-sizing: border-box;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--accent-bg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: all var(--transition-normal);
    width: 100%;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--card-bg);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1400px) {
    #grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }

    aside {
        width: 15vw;
        min-width: 180px;
    }

    .bookmarks {
        width: 86vw;
    }

    #categories li {
        padding: 0.8rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 1200px) {
    #grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    aside {
        width: 16vw;
        min-width: 160px;
    }

    .bookmarks {
        width: 84vw;
    }

    #categories li {
        padding: 0.7rem 0.7rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 968px) {
    h1 {
        font-size: 2rem;
    }

    .app-header {
        height: 10vh;
        padding: 1rem;
    }

    .content {
        height: 83vh;
        flex-direction: column;
    }

    aside {
        width: 100vw;
        height: 35vh;
        border-right: none;
        border-bottom: 1px solid var(--accent-bg);
        overflow: hidden;
    }

    .search-container {
        padding: 0.8rem 1rem;
        min-height: 60px;
    }

    #categories {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        height: calc(35vh - 60px);
    }

    #categories li {
        padding: 1rem 1.5rem;
        border-right: 1px solid rgba(71, 85, 105, 0.3);
        border-bottom: none;
        display: inline-block;
        white-space: nowrap;
        min-width: 150px;
        min-height: 50px;
    }

    .bookmarks {
        width: 100vw;
        height: 65vh;
    }

    #grid {
        grid-template-columns: repeat(auto-fill, 320px);
        margin: 1rem 0.5rem;
    }

    #grid > div {
        width: 320px;
        height: 260px;
    }

    .footer {
        height: 7vh;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    #page-no {
        padding-left: 0;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-header {
        height: 8vh;
    }

    .content {
        height: 92vh;
        flex-direction: column;
    }

    aside {
        width: 100vw;
        height: 25vh;
        border-right: none;
        border-bottom: 1px solid var(--accent-bg);
    }

    .search-container {
        padding: 0.5rem;
        min-height: 50px;
    }

    .search-input {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    #categories {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
        gap: 0.5rem;
        height: calc(25vh - 50px);
        align-items: flex-start;
    }

    #categories li {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        margin: 0;
        white-space: nowrap;
        min-width: auto;
        flex-shrink: 0;
    }

    .bookmarks {
        width: 100vw;
        height: 67vh;
    }

    #grid {
        margin: 0.5rem;
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0 0.25rem;
    }

    #grid > div {
        min-height: 240px;
        max-height: 280px;
        overflow-y: auto;
    }

    #grid div a {
        font-size: 0.9rem;
        padding: 0.8rem 0.6rem;
    }

    button {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        min-width: 80px;
    }

    .footer {
        height: 8vh;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .footer-left {
        flex: 1;
    }

    .footer-stats {
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.7rem;
    }

    .footer-stats span {
        font-size: 0.7rem;
    }

    #page-no {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    .footer-right {
        flex-shrink: 0;
    }

    .pagination-controls {
        display: flex;
        gap: 0.5rem;
    }

    .card-loading .loading-spinner {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }

    .card-loading .loading-text {
        font-size: 0.8rem;
    }

    /* Mobile category adjustments */
    .category-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.5rem !important;
        top: 8px !important;
        left: 8px !important;
    }

    #grid > div::before {
        opacity: 0.2;
    }

    #grid > div:hover::before {
        opacity: 0.4;
    }

    #grid > div:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

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

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --tile-bg: #ffffff;
        --text-dark: #1e293b;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
.search-input:focus-visible,
#categories li:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .app-header,
    .footer,
    #categories {
        display: none;
    }

    .content {
        flex-direction: column;
        height: auto;
    }

    .bookmarks {
        width: 100%;
        height: auto;
    }

    #grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #grid > div {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
