:root {
    --python-blue: #306998;
    --python-yellow: #ffd43b;
    --python-green: #3c873a;
    --dark: #222;
    --light: #f8f9fa;
    --gray-100: #f0f0f0;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --header-height: 60px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    position: relative;
    padding-top: var(--header-height);
}

/* Header styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    background: var(--light);
    border-bottom: 1px solid var(--gray-200);
}

.header.home {
    justify-content: flex-end;
    background: transparent;
    border-bottom: none;
}

/* Logo styles */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
}

.logo.home {
    position: relative;
    font-size: 3.5rem;
    margin-bottom: 2rem;
}

.logo.home::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: var(--python-yellow);
    border-radius: 50%;
    top: -15px;
    left: -25px;
    z-index: -1;
    opacity: 0.6;
}

.logo .py-blue {
    color: var(--python-blue);
}

.logo .py-yellow {
    color: var(--python-yellow);
}

/* Container styles */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container.home {
    max-width: 800px;
    text-align: center;
}

/* Common link styles */
a {
    text-decoration: none;
    color: var(--python-blue);
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
    color: var(--python-green);
}

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    gap: 0.4rem;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

/* Primary button variant */
.btn-primary {
    background: var(--python-blue);
    color: white;
    border-color: var(--python-blue);
}

.btn-primary:hover {
    background: white;
    color: var(--python-blue);
}

/* Success button variant */
.btn-success {
    background: var(--python-green);
    color: white;
    border-color: var(--python-green);
}

.btn-success:hover {
    background: white;
    color: var(--python-green);
}

.github-link svg {
    margin-right: 0.5rem;
}

/* Home page specific styles */
.home h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.tagline {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--gray-600);
}

.stat-number {
    font-weight: 700;
    color: var(--python-blue);
    font-size: 1.2rem;
}

.stat-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.home p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--gray-600);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.url-pattern {
    display: inline-block;
    padding: 1rem 1.5rem;
    background-color: var(--gray-100);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--python-blue);
    border-left: 4px solid var(--python-yellow);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    word-break: break-all;
}

.section-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.examples-list {
    list-style: none;
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    text-align: left;
    width: 100%;
}

.examples-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    padding-left: 1.5rem;
}

.examples-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--python-green);
    font-weight: bold;
}

.examples-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.examples-list a {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    word-break: break-all;
    display: inline-block;
}

.supported-packages {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0 auto 2.5rem auto;
    box-shadow: var(--shadow-md);
    width: 90%;
    max-width: 1200px;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    list-style: none;
}

.packages-grid li {
    background-color: var(--gray-100);
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.packages-grid li:hover {
    background-color: var(--gray-200);
    border-color: var(--python-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.packages-grid a {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
}

.stdlib-package {
    background-color: var(--python-yellow) !important;
    opacity: 0.9;
}

.stdlib-package:hover {
    background-color: var(--python-yellow) !important;
    opacity: 1;
    border-color: var(--python-blue);
}

.stdlib-package a {
    color: var(--dark);
    font-weight: 600;
}

.stdlib-package a:hover {
    color: var(--python-blue);
}

.footer {
    margin-bottom: 1rem;
}

.footer p {
    text-align: center;
    padding: 1rem 0 2rem 0;
    color: var(--gray-600);
    font-size: 0.85rem;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0 auto 0.5rem;
    padding: 0.2rem 0;
}

/* Search page specific styles */
.search-form {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.search-form form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--python-blue);
}

.search-button {
    /* Uses .btn and .btn-primary base styles */
    padding: 1rem 1.2rem;
    font-size: 1rem;
}

.lucky-button {
    /* Uses .btn and .btn-success base styles */
    padding: 1rem 1.2rem;
    font-size: 1rem;
}

.results-header {
    margin-bottom: 1.5rem;
    padding-left: 2.5rem;
    color: var(--gray-600);
}

.results-count {
    font-weight: 600;
    color: var(--python-blue);
}

.results-list {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s ease;
    gap: 1rem;
}

.result-item:hover {
    background: var(--gray-100);
}

.result-item:last-child {
    border-bottom: none;
}

.result-symbol {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--python-blue);
    text-decoration: none;
    font-weight: 600;
}

.result-symbol:hover {
    text-decoration: underline;
}

.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    color: var(--gray-600);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    opacity: 0;
    visibility: hidden;
}

.result-item:hover .copy-button {
    opacity: 1;
    visibility: visible;
}

.copy-button:hover {
    background: var(--gray-200);
    color: var(--python-blue);
}

.result-url {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-family: var(--font-mono);
    word-break: break-all;
}

.no-results {
    text-align: center;
    color: var(--gray-600);
    font-size: 1.1rem;
    padding: 2rem;
}

.hidden-result {
    display: none;
}

.show-more-container {
    text-align: center;
    padding: 1.5rem 1rem 0;
    border-top: 1px solid var(--gray-200);
}

.show-more-button {
    background: var(--gray-100);
    color: var(--python-blue);
    border: 1px solid var(--gray-300);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.show-more-button:hover {
    background: var(--gray-200);
    border-color: var(--python-blue);
}

/* Notification popup styles */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--python-blue);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.1);
    max-width: 90%;
    word-break: break-all;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.hiding {
    opacity: 0;
    transform: translateX(-50%) translateY(100px);
    transition: all 0.4s ease-out;
}

.notification.hidden {
    display: none;
}

/* Responsive styles */
@media (min-width: 1000px) {
    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 740px) {
    .search-form form {
        flex-direction: column;
        gap: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .search-button {
        width: 100%;
        justify-content: center;
    }

    .lucky-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 2rem 1rem;
    }

    .home h1 {
        font-size: 2.8rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .stat {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .home p {
        font-size: 1.1rem;
    }

    .url-pattern {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    .logo.home::before {
        width: 50px;
        height: 50px;
        top: -12px;
        left: -20px;
    }

    .examples-list {
        padding: 1.2rem 1rem;
    }

    .examples-list a {
        font-size: 0.85rem;
    }

    .examples-list li {
        padding-left: 1.2rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .supported-packages {
        padding: 1.2rem 1rem;
    }

    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
    }

    .packages-grid a {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .github-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .github-link svg {
        width: 18px;
        height: 18px;
    }

    .header {
        padding: 0 1rem;
    }

    .result-item {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .result-url {
        width: 100%;
    }

    .search-form {
        padding: 1.5rem;
    }

    .results-list {
        padding: 1rem;
    }
}

@media (max-width: 400px) {
    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .stats {
        flex-direction: column;
        gap: 0.8rem;
    }
}
