/* Enhanced Category Page Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --light-gray: #f3f4f6;
    --medium-gray: #9ca3af;
    --dark-gray: #4b5563;
    --white: #ffffff;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.category-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 6rem 5%;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.category-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 30s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.category-hero .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    color: rgba(255, 255, 255, 0.6);
}

.category-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.category-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Enhanced Category Filters */
.category-filters {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 2.5rem 5%;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filters-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.filter-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.filter-select option {
    padding: 0.5rem;
    background: white;
    color: var(--text-color);
}

.filter-select option[value=""] {
    font-weight: 600;
    color: var(--primary-color);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: auto;
}

.clear-filters-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.clear-filters-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.clear-filters-btn:active {
    transform: translateY(0);
}

/* Blocks Grid Section */
.blocks-grid {
    padding: 3rem 5%;
    background: var(--light-gray);
}

.blocks-grid .container {
    max-width: 1200px;
    margin: 0 auto;
}

.resource-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.filter-tag button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.results-count {
    color: var(--dark-gray);
    font-weight: 500;
}

/* Blocks Container */
.blocks-container {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.blocks-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ad-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Block Divider */
.block-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 1rem 0;
}

/* Ad Space */
.ad-space {
    width: 250px;
    height: 300px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-space:first-child {
    height: 600px;
}

.ad-space .ad-content {
    text-align: center;
    color: #64748b;
    padding: 1rem;
}

.ad-space .ad-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.ad-space .ad-content h4 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-space .ad-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.block-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: row;
    position: relative;
    min-height: 500px;
    max-height: 500px;
}

.block-image {
    width: 300px;
    height: 100%;
    background-color: #e5e7eb;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.block-info {
    padding: 0.4rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.block-info h3 {
    margin-bottom: 0.3rem;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.block-meta {
    display: flex;
    justify-content: space-between;
    color: var(--medium-gray);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.block-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-meta i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.block-info p {
    color: var(--dark-gray);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex-grow: 1;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.block-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: #f0f4f8;
    color: #4a5568;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* Enhanced Premium and Free Badges */
.premium-badge, .free-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.premium-badge {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.free-badge {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Expanded Block Styles */
.expanded-block {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    position: relative;
}

.expanded-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.expanded-block .block-image {
    width: 60px;
    height: 100%;
}

.expanded-block .block-info {
    padding: 0.5rem;
}

.block-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    margin: 0.375rem 0;
    padding: 0.375rem;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.spec-label {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
}

.spec-value {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.block-download {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    padding: 0.375rem;
    border-radius: 6px;
    margin: 0.375rem 0;
    text-align: center;
}

.block-download h4 {
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.download-buttons .btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.download-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
}

.download-buttons .btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.download-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.personal-use-notice {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    text-align: left;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.disclaimer {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    text-align: left;
}

.block-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Enhanced Buttons */
.view-details-btn {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-details-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.view-details-btn:active {
    transform: translateY(0);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-numbers a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.page-numbers a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-numbers a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-numbers span {
    color: var(--medium-gray);
    padding: 0 0.5rem;
}

/* Horizontal Footer Links */
.footer-links-horizontal {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer-links-horizontal a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.footer-links-horizontal a:hover {
    color: var(--primary-color);
}

.footer-links-horizontal a i {
    font-size: 0.9rem;
    margin-right: 1rem !important;
}

/* Footer Contact Spacing */
.footer-contact p i {
    margin-right: 1rem !important;
}

/* Dark Hero Only */
.category-hero {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

.category-hero h1,
.category-hero p {
    color: white !important;
}

/* Category Info Section */
.category-info {
    padding: 4rem 5%;
    background: white;
}

.category-info .container {
    max-width: 1200px;
    margin: 0 auto;
}

.category-info h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

.category-info h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

.info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.info-text p {
    color: var(--dark-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.info-text ul {
    list-style: none;
    padding: 0;
}

.info-text li {
    color: var(--dark-gray);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-text li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.info-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Comprehensive Responsive Design */
@media (max-width: 1200px) {
    .blocks-container {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    .blocks-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .ad-column {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .footer-links-horizontal {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 3rem 5%;
    }
    
    .category-hero h1 {
        font-size: 2.5rem;
    }
    
    .category-hero p {
        font-size: 1.1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-select {
        min-width: auto;
        flex: 1;
    }
    
    .blocks-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .resource-filters {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .info-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .block-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .download-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links-horizontal {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 780px) {
    .category-hero {
        padding: 2rem 5%;
    }
    
    .category-hero h1 {
        font-size: 2.2rem;
    }
    
    .category-hero p {
        font-size: 1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-select {
        min-width: auto;
        flex: 1;
    }
    
    .blocks-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .blocks-column {
        width: 100%;
    }
    
    .resource-filters {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .info-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .block-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .download-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .download-buttons .btn {
        width: 100% !important;
        padding: 0.8rem 1rem !important;
        font-size: 0.95rem !important;
        justify-content: center;
        display: flex;
        align-items: center;
        min-height: 44px; /* Touch target size */
    }
    
    .footer-links-horizontal {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Fix block cards for 780px and below */
    .block-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .block-info {
        padding: 1rem;
    }
    
    .block-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .block-info p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Ensure buttons and details are visible */
    .block-specs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .spec-item {
        padding: 0.5rem;
        background: #f9fafb;
        border-radius: 6px;
        border: 1px solid #e5e7eb;
    }
    
    .block-download {
        display: block !important;
        padding: 1rem;
        background: #f9fafb;
        border-radius: 8px;
        margin-top: 1rem;
    }
    
    .block-download h4 {
        display: block !important;
        font-size: 1rem;
        margin-bottom: 0.75rem;
        color: var(--text-color);
    }
    
    .view-details-btn {
        display: inline-flex !important;
        width: auto;
        min-width: 140px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin-top: 0.75rem;
    }
    
    .personal-use-notice {
        display: block !important;
        font-size: 0.75rem;
        padding: 0.5rem;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .disclaimer {
        display: block !important;
        font-size: 0.8rem;
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    /* Fix ad column */
    .ad-column {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .ad-space {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 480px) {
    /* Container and Layout */
    .blocks-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 1rem;
    }
    
    .blocks-column {
        width: 100%;
    }
    
    /* Block Cards */
    .block-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .block-image {
        height: 200px;
        width: 100%;
    }
    
    .block-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .block-info {
        padding: 1rem;
    }
    
    .block-info h3 {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .block-info p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Meta and Tags */
    .block-meta {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    .block-meta span {
        font-size: 0.8rem;
    }
    
    .block-tags {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Specifications */
    .block-specs {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    
    .spec-item {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .spec-label {
        font-size: 0.8rem;
    }
    
    .spec-value {
        font-size: 0.85rem;
    }
    
    /* Download Section */
    .block-download {
        padding: 0.75rem;
    }
    
    .block-download h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .download-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .download-buttons .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .personal-use-notice {
        font-size: 0.7rem;
        padding: 0.5rem;
        text-align: center;
    }
    
    /* Stats */
    .block-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
    
    .stat {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Disclaimer */
    .disclaimer {
        font-size: 0.75rem;
        padding: 0.75rem;
        line-height: 1.3;
    }
    
    /* Hero Section */
    .category-hero {
        padding: 2rem 1rem !important;
        text-align: center;
    }
    
    .category-hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .category-hero p {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .page-numbers {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-numbers a {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    /* Ad Column */
    .ad-column {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .ad-space {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1.2;
    }
    
    /* Footer */
    .footer-links-horizontal {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .footer-links-horizontal a {
        font-size: 0.9rem;
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    /* General Improvements */
    .container {
        padding: 0 1rem;
    }
    
    /* Fix overflow issues */
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .footer-mid,
    .footer-bottom,
    .ad-column,
    .pagination,
    .social-links {
        display: none !important;
    }
    
    .block-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .block-card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}

/* iPhone and iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific fixes */
    .blocks-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .block-card {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .download-buttons .btn {
        -webkit-appearance: none;
        appearance: none;
        -webkit-border-radius: 8px;
        border-radius: 8px;
    }
}

/* iPhone SE and smaller screens */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 667px) 
    and (-webkit-device-pixel-ratio: 2) {
    
    .blocks-container {
        padding: 0 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .block-info {
        padding: 0.75rem !important;
    }
    
    .block-info h3 {
        font-size: 1rem !important;
    }
    
    .block-info p {
        font-size: 0.85rem !important;
    }
    
    .download-buttons .btn {
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
    }
    
    .category-hero h1 {
        font-size: 1.6rem !important;
    }
    
    .category-hero p {
        font-size: 0.9rem !important;
    }
}

/* iPhone 12/13/14 */
@media only screen 
    and (device-width: 390px) 
    and (device-height: 844px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    .blocks-container {
        padding: 0 1rem !important;
    }
    
    .block-image {
        height: 180px !important;
    }
    
    .category-hero {
        padding: 1.5rem 1rem !important;
    }
    
    .category-hero h1 {
        font-size: 1.7rem !important;
    }
}

/* iPhone 12/13/14 Pro Max */
@media only screen 
    and (device-width: 428px) 
    and (device-height: 926px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    .blocks-container {
        padding: 0 1.25rem !important;
        gap: 1.25rem !important;
    }
    
    .block-image {
        height: 220px !important;
    }
    
    .category-hero h1 {
        font-size: 1.9rem !important;
    }
}

/* iPhone X/11/12/13 Pro */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    .category-hero {
        padding: 2rem 1rem 1rem !important;
        padding-top: calc(2rem + env(safe-area-inset-top)) !important;
    }
    
    .blocks-container {
        padding: 0 1rem !important;
    }
    
    .block-image {
        height: 190px !important;
    }
}

/* Safe Area Support for Notched iPhones */
@supports (padding: max(0px)) {
    .category-hero {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
        padding-top: max(2rem, env(safe-area-inset-top)) !important;
    }
    
    .blocks-container {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }
    
    .footer-links-horizontal {
        padding-left: max(0, env(safe-area-inset-left)) !important;
        padding-right: max(0, env(safe-area-inset-right)) !important;
    }
}

/* Landscape Mode for iPhones */
@media only screen 
    and (max-device-width: 428px) 
    and (orientation: landscape) {
    
    .blocks-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0 1rem !important;
    }
    
    .block-image {
        height: 120px !important;
    }
    
    .category-hero {
        padding: 1rem !important;
        min-height: auto !important;
    }
    
    .category-hero h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .category-hero p {
        font-size: 0.9rem !important;
    }
    
    .block-stats {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.25rem !important;
    }
    
    .stat {
        padding: 0.5rem 0.25rem !important;
    }
    
    .stat-number {
        font-size: 0.9rem !important;
    }
    
    .stat-label {
        font-size: 0.65rem !important;
    }
}

/* iOS Safari Scroll Fix */
@supports (-webkit-overflow-scrolling: touch) {
    .blocks-container,
    .ad-column {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
    }
    
    /* Prevent elastic scrolling */
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: auto;
    }
    
    /* Fix for iOS zoom on input focus */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    .newsletter-form input {
        font-size: 16px !important;
    }
}

/* Additional Mobile Fixes */
@media (max-width: 428px) {
    /* Ensure no horizontal scrolling */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix container widths */
    .container, .blocks-container, .blocks-column, .ad-column {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Fix card layouts */
    .block-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }
    
    /* Fix images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix text overflow */
    h1, h2, h3, h4, p, span, div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    /* Fix button widths */
    .btn, .download-buttons .btn {
        width: auto !important;
        min-width: 120px !important;
        max-width: 100% !important;
    }
    
    /* Fix pagination */
    .page-numbers a {
        min-width: 35px !important;
        min-height: 35px !important;
    }
}