:root {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary-color: #8b5cf6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

.page-header {
    text-align: center;
    padding: 6rem 2rem;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #f9f5ff 0%, #f0e9ff 100%);
    border-radius: 0 0 1.5rem 1.5rem;
    position: relative;
    overflow: hidden;
    max-width: 1800px;
    box-shadow: 0 4px 30px rgba(108, 43, 217, 0.05);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.page-header h1 {
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    margin: 3rem auto;
    max-width: 1440px;
}

/* Three column layout for larger screens */
@media (min-width: 1200px) {
    .download-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Two column layout for medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
}

/* Single column for mobile */
@media (max-width: 767px) {
    .download-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 1.25rem;
        max-width: 500px;
    }
    
    .page-header {
        padding: 3rem 1.25rem;
        margin: 0 0 1.5rem 0;
        border-radius: 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
}

.download-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

.download-card:hover::before {
    opacity: 1;
}

.download-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.download-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.download-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.download-card:hover .download-image::before {
    opacity: 0.8;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.download-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-card:hover .download-image img {
    transform: scale(1.08);
}

.download-content {
    padding: 1.75rem 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    z-index: 2;
}

.download-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.875rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.download-content p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.download-content p::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 80%);
    pointer-events: none;
}

.download-now {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: auto;
    padding: 0.75rem 1.25rem;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    align-self: flex-start;
}

.download-now::after {
    content: '';
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237c3aed'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-card:hover .download-now {
    background: rgba(124, 58, 237, 0.12);
    color: var(--primary-hover);
    transform: translateX(4px);
}

.download-card:hover .download-now::after {
    transform: translateX(3px);
}

.no-downloads {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 1.125rem;
    color: var(--text-light);
    grid-column: 1 / -1;
    background: var(--bg-light);
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* Download Detail Page */
.download-detail-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-top: 40px;
    align-items: center;
}

.download-detail-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.download-detail-content h1 {
    font-size: 2.8em;
    margin-bottom: 20px;
}

.download-detail-content p {
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 30px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
}

.icon-download {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
}
