/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Single accent color - Nordic blue */
:root {
    --accent-color: #0066cc;
    --accent-dark: #0052a3;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --border: #e1e5e9;
}

.app-container {
    max-width: 414px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--background);
    position: relative;
}



/* Main content */
.main-content {
    padding: 0 20px 100px;
}

.section {
    margin-bottom: 24px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--background-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--background-alt);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* View All Button */
.view-all {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
}

.view-all:active {
    opacity: 0.6;
}

/* Unified Header Card */
.unified-header {
    margin: 20px;
    margin-bottom: 24px;
}

.header-background {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0052a3 100%);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 2;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 24px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.profile-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.header-banner-text {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Ranking Section - Horizontal Scroll */
.ranking-container {
    position: relative;
}

.ranking-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0 24px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
}

.ranking-scroll::-webkit-scrollbar {
    display: none;
}

.ranking-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.product-card.ranking {
    flex: 0 0 180px;
    aspect-ratio: 0.85;
    border-radius: 12px;
    overflow: visible;
    position: relative;
    cursor: pointer;
    border: none;
    background: var(--background-alt);
    margin-top: 16px;
}

.product-image-large {
    width: 100%;
    height: 70%;
    position: relative;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.product-placeholder-large {
    width: 100%;
    height: 100%;
    background: var(--background-alt);
    border-radius: 12px 12px 0 0;
}

.product-img-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 0 0 12px 12px;
}

.product-overlay .product-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.product-price {
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Ranking Badges with Animation */
.ranking-badge {
    position: absolute;
    top: -16px;
    left: -16px;
    width: 32px;
    height: 32px;
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 4px 4px 0px rgba(255, 107, 53, 0.3);
    animation: wiggle 2s ease-in-out infinite;
    animation-delay: var(--animation-delay, 0s);
}

.product-card.ranking:nth-child(1) .ranking-badge { --animation-delay: 0s; }
.product-card.ranking:nth-child(2) .ranking-badge { --animation-delay: 0.2s; }
.product-card.ranking:nth-child(3) .ranking-badge { --animation-delay: 0.4s; }
.product-card.ranking:nth-child(4) .ranking-badge { --animation-delay: 0.6s; }
.product-card.ranking:nth-child(5) .ranking-badge { --animation-delay: 0.8s; }

@keyframes wiggle {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(0deg) translate(0px, 0px);
    }
    10% {
        transform: rotate(-3deg) translate(-1px, -1px);
    }
    30% {
        transform: rotate(3deg) translate(1px, 1px);
    }
    40% {
        transform: rotate(-2deg) translate(-1px, 0px);
    }
    60% {
        transform: rotate(2deg) translate(1px, -1px);
    }
    70% {
        transform: rotate(-1deg) translate(0px, 1px);
    }
}

/* Buy Buttons */
.buy-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--accent-color);
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Compact Products */
.compact-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-item.compact {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
}

.product-image-small {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.product-placeholder-small {
    width: 100%;
    height: 100%;
    background: var(--background-alt);
    border-radius: 12px;
}

.product-img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.product-details {
    flex: 1;
}

.compact .product-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.compact .product-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tips Section */
.tips-articles {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.tip-item:active {
    transform: scale(0.98);
    background: var(--background-alt);
}

.tip-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.tip-placeholder {
    width: 100%;
    height: 100%;
    background: var(--background-alt);
    border-radius: 8px;
}

.tip-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.tip-content {
    flex: 1;
}

.tip-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tip-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Interactions */
.product-card:active,
.product-item:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.buy-btn:active {
    transform: scale(0.95);
    background: var(--accent-dark);
}



/* No hover effects - mobile first */
@media (min-width: 768px) {
    .app-container {
        max-width: 414px;
    }
}

/* Resource Cards Section */
.resource-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resource-card.large {
    background: var(--background);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.resource-card.large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.resource-card.large:active {
    transform: translateY(0) scale(0.98);
}

.resource-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.resource-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-content {
    padding: 20px;
}

.resource-tag {
    background: var(--accent-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 12px 0 8px;
    line-height: 1.3;
}

.resource-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.resource-source {
    font-weight: 500;
    color: var(--accent-color);
}

.resource-duration {
    font-weight: 400;
}

/* Accessibility */
.product-card:focus,
.product-item:focus,
.buy-btn:focus,
.tip-item:focus,
.nav-btn:focus,
.view-all:focus,
.resource-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.product-card:focus:not(:focus-visible),
.product-item:focus:not(:focus-visible),
.buy-btn:focus:not(:focus-visible),
.tip-item:focus:not(:focus-visible),
.nav-btn:focus:not(:focus-visible),
.view-all:focus:not(:focus-visible),
.resource-card:focus:not(:focus-visible) {
    outline: none;
} 