:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --bg-color: #f0f2f5;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --card-bg: #ffffff;
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.top-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: var(--primary-color);
}

.nav-link i {
    color: var(--primary-color);
}

header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.5);
    height: 100%; /* Ensure full height in grid */
    text-decoration: none; /* Prevent underlines on text */
}

/* Ensure no underlines on anchor cards in any state */
a.card, a.card:hover, a.card:focus,
a.category-card, a.category-card:hover, a.category-card:focus {
    text-decoration: none;
    color: inherit;
}

/* Double safety for child elements */
a.card *, a.category-card * {
    text-decoration: none;
}

/* Category Card specific styles */
.category-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.category-card .icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.category-card:hover .icon {
    transform: scale(1.1);
}

.disabled-card {
    opacity: 0.7;
    cursor: not-allowed !important;
    filter: grayscale(100%);
    background: #f3f4f6;
}

.disabled-card:hover {
    transform: none !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.provider-tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card.recommended {
    border: 2px solid var(--primary-color);
    background: linear-gradient(to bottom, #fff, #f8faff);
}

.card.secondary {
    border: 1px solid var(--secondary-color); /* Adjusted to look slightly less aggressive than recommended but still highlighted */
    background: linear-gradient(to bottom, #fff, #f0fdf9);
}

.badge {
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 3rem;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card.secondary .badge {
    background: var(--secondary-color);
}

.icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.card.secondary .icon {
    color: var(--secondary-color);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    background: #e5e7eb;
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #d1d5db;
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--text-color);
    background-color: #f9fafb;
}

.share-code-container {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
    font-size: 1rem;
}

.btn-copy:hover {
    color: var(--primary-color);
}

footer {
    text-align: center;
    color: var(--text-light);
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

@media (max-width: 899px) {
    body {
        justify-content: flex-start;
        background: #f8fafc; /* Simpler background for mobile */
    }
    
    .container {
        padding: 1rem;
        height: auto;
    }

    header {
        margin-bottom: 1.5rem;
    }

    .top-nav {
        margin-bottom: 1.5rem;
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .download-options {
        gap: 1rem;
    }

    .card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 1rem;
        border-radius: 0.75rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        background: #fff;
    }

    /* Category Card Mobile adjustments */
    .category-card .icon {
        font-size: 2.5rem;
        margin-bottom: 0;
        margin-right: 1rem;
        width: auto;
    }

    .category-card .btn {
        width: auto;
        min-width: 100px;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .card:hover {
        transform: none;
        box-shadow: none;
    }

    .card.recommended {
        border: 1px solid #e5e7eb;
        border-left: 4px solid var(--primary-color);
        background: #fff;
    }
    
    .card.secondary {
        border-left: 4px solid var(--secondary-color);
        background: #fff;
    }

    .icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-right: 1rem;
        width: 32px;
        text-align: center;
    }

    .card-content {
        align-items: flex-start;
        text-align: left;
        flex-grow: 1;
    }

    .card h2 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .tags {
        justify-content: flex-start;
        margin-bottom: 0;
        transform: scale(0.9);
        transform-origin: left center;
        margin-left: -2px;
    }

    .card p {
        display: none; /* Hide description on mobile to save space */
    }

    /* Show description for category cards if needed, or keep hidden */
    .category-card p {
        display: block; /* Restore description for category cards if brief */
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .badge {
        display: none;
    }

    .btn {
        width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        margin-left: 0.5rem;
        white-space: nowrap;
        box-shadow: none;
    }
    
    .share-code-container {
        margin-bottom: 0;
        margin-top: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        width: 100%;
        background: #f8fafc;
    }
    
    .card:has(.share-code-container) {
        flex-wrap: wrap;
    }
    
    .card:has(.share-code-container) .card-content {
        width: calc(100% - 40px - 80px);
    }
}

@media (min-width: 900px) {
    .download-options {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Software List Grid on Desktop */
    .software-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Software Page Specifics */
.search-hero {
    background: transparent;
    padding: 1rem 0 2rem 0;
    border-radius: 0;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: none;
}

.search-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.search-hero p {
    color: var(--text-light);
    opacity: 1 !important; /* Override inline style if any */
}

.search-container {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-left: 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    box-shadow: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: none;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
    z-index: 10;
    transition: color 0.2s;
}

.search-input:focus + .search-icon,
.search-container:focus-within .search-icon {
    color: var(--primary-color);
}

.software-item {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.software-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.software-info {
    flex: 1;
    margin-right: 1.5rem;
}

.software-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.software-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.code-badge {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.code-badge:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.software-actions .btn-sm {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    min-width: 40px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

@media (max-width: 640px) {
    .software-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .software-info {
        margin-right: 0;
        width: 100%;
    }
    
    .software-actions {
        width: 100%;
        display: flex;
    }
    
    .software-actions .btn {
        flex: 1;
        justify-content: center;
    }
}