/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Variables */
    --color-buy: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --color-day: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    --color-games: linear-gradient(135deg, #A8E6CF 0%, #7B68EE 100%);
    --color-tools: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    
    --color-buy-solid: #FF6B6B;
    --color-day-solid: #4ECDC4;
    --color-games-solid: #7B68EE;
    --color-tools-solid: #667EEA;
    
    --bg-primary: #0A0E27;
    --bg-secondary: #1A1F3A;
    --text-primary: #FFFFFF;
    --text-secondary: #B8BCC8;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    line-height: 1.6;
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* ============================================
   Container - 100vh Full Screen Layout
   ============================================ */
.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm) var(--spacing-xl);
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
}

/* ============================================
   Header
   ============================================ */
.header {
    flex: 0 0 auto;
    padding: var(--spacing-xs) 0;
    margin-bottom: var(--spacing-xs);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, #FFFFFF 0%, #B8BCC8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.hero-tagline {
    font-size: clamp(0.875rem, 1.5vw, 1.25rem);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* ============================================
   Cards Grid - Main Content Area - Horizontal Layout
   ============================================ */
.cards-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    min-height: 0;
    padding: calc(var(--spacing-xs) * 0.7) 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    align-items: stretch;
}

/* ============================================
   Card Styles
   ============================================ */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--spacing-sm) * 0.7) calc(var(--spacing-md) * 0.7);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    width: 80%;
    height: 65%;
    align-self: center;
    margin: 0 auto;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.9;
    transition: opacity 0.4s ease;
    z-index: -2;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: opacity 0.4s ease;
}

/* DoFunBuy - Shopping Background Pattern */
.card-buy::before {
    background: var(--color-buy);
}

.card-buy::after {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='shopping' x='0' y='0' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Cpath d='M10 10h20v20H10z' fill='%23ffffff' opacity='0.12'/%3E%3Cpath d='M50 10h20v20H50z' fill='%23ffffff' opacity='0.1'/%3E%3Ccircle cx='20' cy='50' r='6' fill='%23ffffff' opacity='0.1'/%3E%3Ccircle cx='60' cy='50' r='8' fill='%23ffffff' opacity='0.08'/%3E%3Cpath d='M15 65 L25 65 L20 55 Z' fill='%23ffffff' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23shopping)'/%3E%3C/svg%3E");
}

/* DoFunDay - Productivity Background Pattern */
.card-day::before {
    background: var(--color-day);
}

.card-day::after {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='productivity' x='0' y='0' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.12'/%3E%3Cline x1='40' y1='40' x2='40' y2='15' stroke='%23ffffff' stroke-width='2' opacity='0.15'/%3E%3Cline x1='40' y1='40' x2='55' y2='40' stroke='%23ffffff' stroke-width='2' opacity='0.15'/%3E%3Cpath d='M10 10 L20 10 L20 20 L10 20 Z' fill='%23ffffff' opacity='0.1'/%3E%3Cpath d='M60 60 L70 60 L70 70 L60 70 Z' fill='%23ffffff' opacity='0.08'/%3E%3Cpath d='M15 50 L25 50 L20 45 L20 55 Z' fill='%23ffffff' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23productivity)'/%3E%3C/svg%3E");
}

/* DoFunGames - Gaming Background Pattern */
.card-games::before {
    background: var(--color-games);
}

.card-games::after {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='gaming' x='0' y='0' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Cpath d='M25 25 L45 25 L45 45 L25 45 Z' fill='%23ffffff' opacity='0.12' transform='rotate(45 35 35)'/%3E%3Ccircle cx='55' cy='25' r='6' fill='%23ffffff' opacity='0.12'/%3E%3Ccircle cx='25' cy='55' r='8' fill='%23ffffff' opacity='0.1'/%3E%3Cpath d='M50 50 L65 50 L65 65 L50 65 Z' fill='%23ffffff' opacity='0.08'/%3E%3Cpath d='M35 35 L45 35 L40 25 Z' fill='%23ffffff' opacity='0.1'/%3E%3Cpath d='M15 15 L20 15 L20 20 L15 20 Z' fill='%23ffffff' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23gaming)'/%3E%3C/svg%3E");
}

/* DoFunTools - AI/Tech Background Pattern */
.card-tools::before {
    background: var(--color-tools);
}

.card-tools::after {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='ai' x='0' y='0' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Cpath d='M15 15 L35 15 L25 35 Z' fill='%23ffffff' opacity='0.12'/%3E%3Cpath d='M45 45 L65 45 L55 65 Z' fill='%23ffffff' opacity='0.1'/%3E%3Ccircle cx='40' cy='40' r='12' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.12'/%3E%3Cpath d='M20 20 L28 28 M52 20 L60 28 M20 60 L28 52 M52 60 L60 52' stroke='%23ffffff' stroke-width='1.5' opacity='0.12'/%3E%3Cpath d='M10 40 L30 40 M50 40 L70 40 M40 10 L40 30 M40 50 L40 70' stroke='%23ffffff' stroke-width='1' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23ai)'/%3E%3C/svg%3E");
}

.card:hover {
    transform: translateY(-12px) scale(1.06);
    box-shadow: var(--shadow-xl);
}

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

.card:hover::after {
    opacity: 0.25;
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: calc(var(--spacing-xs) * 0.85);
    color: var(--text-primary);
    transition: transform 0.4s ease;
}

.card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
}

.card-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.card-title {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    font-weight: 800;
    margin-bottom: calc(var(--spacing-xs) * 0.85);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-slogan {
    font-size: clamp(0.75rem, 1vw, 1rem);
    font-weight: 700;
    margin-bottom: calc(var(--spacing-xs) * 0.85);
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-description {
    font-size: clamp(0.625rem, 0.9vw, 0.75rem);
    font-weight: 400;
    margin-bottom: calc(var(--spacing-xs) * 0.85);
    opacity: 0.85;
    max-width: 100%;
}

.card-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    font-size: clamp(0.625rem, 0.9vw, 0.8125rem);
    font-weight: 700;
    padding: 0.375rem var(--spacing-sm);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card:hover .card-button {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    flex: 0 0 auto;
    text-align: center;
    padding: var(--spacing-xs) 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.hero-title,
.hero-tagline {
    animation: fadeInUp 0.8s ease-out;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .hero {
        margin-bottom: var(--spacing-xs);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-xs) var(--spacing-sm);
        overflow-y: auto;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        padding: var(--spacing-xs) 0;
        align-items: start;
    }
    
    .card {
        padding: var(--spacing-sm) var(--spacing-xs);
        width: 100%;
        height: auto;
        min-height: 200px;
        max-height: none;
        align-self: stretch;
        margin: 0;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        margin-bottom: var(--spacing-xs);
    }
    
    .hero {
        margin-bottom: var(--spacing-xs);
        padding: 0;
    }
    
    .hero-title {
        margin-bottom: 0;
        font-size: 1.5rem;
    }
    
    .hero-tagline {
        font-size: 0.75rem;
    }
    
    .header {
        margin-bottom: var(--spacing-xs);
        padding: 0;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .footer {
        padding: 0;
        font-size: 0.625rem;
    }
    
    .card-description {
        display: block;
        font-size: 0.7rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .card-button {
        padding: 0.375rem var(--spacing-sm);
        font-size: 0.7rem;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: calc(var(--spacing-xs) * 0.5);
    }
    
    .card-slogan {
        font-size: 0.8rem;
        margin-bottom: calc(var(--spacing-xs) * 0.5);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-xs);
        overflow-y: auto;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        align-items: start;
    }
    
    .card {
        padding: var(--spacing-sm);
        width: 100%;
        height: auto;
        min-height: 180px;
        max-height: none;
        align-self: stretch;
        margin: 0;
    }
    
    .card-icon {
        width: 36px;
        height: 36px;
        margin-bottom: var(--spacing-xs);
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .hero-tagline {
        font-size: 0.625rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-slogan {
        font-size: 0.75rem;
    }
    
    .card-description {
        font-size: 0.65rem;
    }
    
    .card-button {
        font-size: 0.65rem;
        padding: 0.3rem var(--spacing-sm);
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.card:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 4px;
}

.card-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

