/* Apple-inspired design for header sections only */
:root {
    --apple-white: #ffffff;
    --apple-light-gray: #f5f5f7;
    --apple-gray: #6e6e73;
    --apple-dark-gray: #1d1d1f;
    --apple-blue: #0066cc;
    --apple-shadow: rgba(0, 0, 0, 0.1);
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
}

/* Base body styles */
body {
    color: #1a1a1a;
    line-height: 1.6;
    background-color: #ffffff;
}

/* Ensure sufficient contrast for all text */
body, p, h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a;
}

/* Ensure proper contrast for secondary text */
.text-muted, .text-secondary {
    color: var(--text-secondary) !important;
}

/* Phone Finder Styles (Updated to Match Image) */
.phone-finder-container {
    background-color: #f5f5f7;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--apple-shadow);
    margin-bottom: 30px;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--apple-dark-gray);
    position: relative;
    display: inline-block;
    padding-left: 28px;
}

.title::before {
    content: '📱'; /* Icon placeholder; replace with actual image or SVG if available */
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.phone-finder-list {
    margin-bottom: 20px;
}

.phone-finder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.phone-finder-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.phone-finder-item {
    display: block;
    padding: 8px 12px;
    color: var(--apple-dark-gray);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.phone-finder-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--apple-blue);
    text-decoration: none;
}

.phone-finder-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.phone-finder-nav-btn {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--apple-gray);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.phone-finder-nav-btn:hover,
.phone-finder-nav-btn.active {
    background-color: var(--apple-blue);
    color: #ffffff;
}

/* Apple-style header cards */
.apple-header-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.apple-header-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.08);
}

/* Add a subtle overlay on hover */
.apple-header-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.02);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.apple-header-card:hover::after {
    opacity: 1;
}

/* Scale up the image slightly on hover */
.apple-header-card:hover .apple-header-img img {
    transform: scale(1.03);
}

/* Articles Section Styles */
.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.article-img {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.article-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-img img {
    transform: scale(1.05);
}

.article-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--apple-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-date {
    font-size: 12px;
    color: var(--apple-gray);
    margin-bottom: 8px;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-title a {
    color: var(--apple-dark-gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--apple-blue);
}

.article-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.read-more {
    color: var(--apple-blue);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.read-more i {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.read-more:hover {
    color: #004d99;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* Filter tabs */
.section-tab-nav {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.section-tab-nav li {
    margin: 0 5px;
}

.section-tab-nav a {
    color: var(--apple-gray);
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.section-tab-nav a:hover,
.section-tab-nav li.active a {
    background: var(--apple-blue);
    color: white;
}

/* View All Container */
.view-all-container {
    width: 100%;
    margin-top: 60px;
    padding: 0 20px;
}

/* View All Buttons Wrapper */
.view-all-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

/* Base Button Styles */
.view-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background: linear-gradient(90deg, var(--apple-blue) 0%, #004d99 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Shimmer Effect */
.view-all-btn::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 0.5s ease;
}

/* Hover State */
.view-all-btn:hover {
    background: linear-gradient(90deg, #004d99, #003366);
    color: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
    text-decoration: none;
}

.view-all-btn:hover::before {
    left: 100%;
}

/* Focus State for Accessibility */
.view-all-btn:focus {
    outline: 3px solid rgba(0, 102, 204, 0.3);
    outline-offset: 3px;
}

/* Success Button Variant (Create New Article) */
.view-all-btn.btn-success {
    background: linear-gradient(90deg, #28a745 0%, #218838 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.view-all-btn.btn-success:hover {
    background: linear-gradient(90deg, #218838, #1e7e34);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.view-all-btn.btn-success::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 0.5s ease;
}

.view-all-btn.btn-success:hover::before {
    left: 100%;
}

/* Poster image container in header cards */
.apple-header-img {
    width: 100%;
    max-width: 1080px;
    height: 200px; /* Default height for non-poster images */
    position: relative;
    overflow: hidden;
    background-color: var(--apple-light-gray);
    display: block;
    line-height: 0; /* Removes any extra space below the image */
    margin: 0 auto; /* Center the container */
}

/* Apply 1080x1080 only to poster images */
.header-card-img {
    height: 1080px; /* Fixed square size for poster images */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa; /* Light gray background for any empty space */
}

.apple-header-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.apple-header-body {
    padding: 24px;
}

.apple-header-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--apple-dark-gray);
}

.apple-header-text {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 18px;
    color: var(--apple-gray);
    margin-bottom: 16px;
}

/* Apple-style buttons */
.apple-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 980px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    margin-right: 8px;
    cursor: pointer;
}

.apple-btn-primary {
    background-color: #0066CC;
    color: white;
    border: none;
}

.apple-btn-primary:hover {
    background-color: #0055AA;
    color: white;
}

.apple-btn-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--apple-dark-gray);
    border: none;
}

.apple-btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.apple-btn-danger {
    background-color: #ff3b30;
    color: white;
    border: none;
}

.apple-btn-danger:hover {
    background-color: #ff594f;
}

.apple-section-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--apple-dark-gray);
    margin-bottom: 24px;
    letter-spacing: -0.003em;
}

.apple-header-buttons {
    display: flex;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .apple-header-buttons {
        flex-direction: column;
    }

    .apple-btn {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }

    .view-all-buttons {
        flex-direction: column;
        gap: 20px;
    }

    .view-all-btn {
        width: 100%;
        max-width: 350px;
        text-align: center;
        padding: 12px 30px;
    }

    .phone-finder-grid {
        grid-template-columns: 1fr;
    }

    .phone-finder-nav {
        flex-direction: column;
        gap: 10px;
    }

    .phone-finder-nav-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .view-all-container {
        margin-top: 40px;
    }

    .view-all-btn {
        font-size: 15px;
        padding: 10px 25px;
    }
}