/* ====================================
   VELORA BENTO GRID SYSTEM
   Modern Modular Layout System
   ==================================== */

/* Bento Grid Container */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    padding: 2rem 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Bento Tile Base Styles */
.bento-tile {
    background: var(--velora-bg-card);
    border: 1px solid var(--velora-border-secondary);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--velora-shadow-sm);
    display: flex;
    flex-direction: column;
}

/* Hover States and Depth Effects */
.bento-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--velora-shadow-lg), 0 0 30px rgba(107, 70, 193, 0.15);
    border-color: var(--velora-border-hover);
}

.bento-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.bento-tile:hover::before {
    left: 100%;
}

/* Clickable Tiles */
.bento-tile.clickable {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.bento-tile.clickable:active {
    transform: translateY(-2px);
}

/* Tile Size Variants - Visual Hierarchy */
.bento-tile-small {
    grid-column: span 3;
    min-height: 200px;
}

.bento-tile-medium {
    grid-column: span 4;
    min-height: 280px;
}

.bento-tile-large {
    grid-column: span 6;
    min-height: 320px;
}

.bento-tile-wide {
    grid-column: span 8;
    min-height: 240px;
}

.bento-tile-full {
    grid-column: span 12;
    min-height: 200px;
}

/* Hero Tile - Main Feature */
.bento-tile-hero {
    grid-column: span 5;
    min-height: 400px;
}

/* Zodiac Full Grid Tile */
.bento-tile-zodiac-full {
    grid-column: span 7;
    min-height: 400px;
}

/* Tile Height Variants */
.bento-tile-tall {
    min-height: 400px;
}

.bento-tile-short {
    min-height: 180px;
}

/* Featured Tile - Emphasized Content */
.bento-tile-featured {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 2px solid var(--velora-accent-primary);
    box-shadow: var(--velora-shadow-glow);
}

.bento-tile-featured:hover {
    box-shadow: var(--velora-shadow-glow), 0 0 40px rgba(107, 70, 193, 0.3);
}

/* Tile Content Structure */
.bento-tile-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--velora-accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: rgba(107, 70, 193, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.bento-tile:hover .bento-tile-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(107, 70, 193, 0.2);
}

.bento-tile-header {
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.bento-tile-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--velora-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.bento-tile-subtitle {
    font-size: 0.875rem;
    color: var(--velora-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.bento-tile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.bento-tile-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--velora-text-secondary);
    margin-bottom: 1.5rem;
}

.bento-tile-action {
    margin-top: auto;
    padding-top: 1rem;
}

.bento-tile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--velora-accent-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.bento-tile-link:hover {
    color: var(--velora-accent-secondary);
    transform: translateX(4px);
}

.bento-tile-link i {
    transition: transform 0.3s ease;
}

.bento-tile-link:hover i {
    transform: translateX(4px);
}

/* Daily Horoscope Tile Specific */
.bento-tile-horoscope {
    background: var(--velora-gradient-primary);
    color: var(--velora-text-inverse);
}

.bento-tile-horoscope .bento-tile-title,
.bento-tile-horoscope .bento-tile-description {
    color: var(--velora-text-inverse);
}

.bento-tile-horoscope .bento-tile-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--velora-text-inverse);
}

.bento-tile-horoscope:hover .bento-tile-icon {
    background: rgba(255, 255, 255, 0.3);
}

/* Zodiac Grid Inside Tile */
.bento-zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bento-zodiac-grid-full {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.bento-zodiac-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid var(--velora-border-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.bento-zodiac-item:hover {
    background: rgba(107, 70, 193, 0.15);
    border-color: var(--velora-accent-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--velora-shadow-md);
}

.bento-zodiac-icon {
    width: 3rem;
    height: 3rem;
    color: var(--velora-accent-primary);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

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

.bento-zodiac-name {
    font-size: 0.875rem;
    color: var(--velora-text-primary);
    text-align: center;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.bento-zodiac-dates {
    font-size: 0.7rem;
    color: var(--velora-text-secondary);
    text-align: center;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

/* Quick Actions Tile */
.bento-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.bento-actions-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.bento-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: rgba(107, 70, 193, 0.08);
    border-radius: 16px;
    border: 1px solid var(--velora-border-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.bento-action-item:hover {
    background: rgba(107, 70, 193, 0.15);
    border-color: var(--velora-accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--velora-shadow-md);
}

.bento-action-icon {
    font-size: 2rem;
    color: var(--velora-accent-primary);
}

.bento-action-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--velora-text-primary);
}

/* Stats and Metrics Display */
.bento-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bento-stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--velora-accent-primary);
    line-height: 1;
}

.bento-stat-label {
    font-size: 0.875rem;
    color: var(--velora-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Badge and Labels */
.bento-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(107, 70, 193, 0.1);
    border: 1px solid rgba(107, 70, 193, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--velora-accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bento-badge-new {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--velora-success);
}

.bento-badge-featured {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: rgba(212, 175, 55, 0.3);
    color: var(--velora-accent-gold);
}

/* Decorative Elements */
.bento-tile-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

.bento-tile-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(107, 70, 193, 0.15) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.bento-tile:hover .bento-tile-glow {
    opacity: 1;
}

/* Constellation Canvas Overlay */
.constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.constellation-card:hover .constellation-canvas {
    opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .bento-tile-small,
    .bento-tile-medium {
        grid-column: span 4;
    }

    .bento-tile-large,
    .bento-tile-hero {
        grid-column: span 6;
    }

    .bento-tile-wide,
    .bento-tile-zodiac-full {
        grid-column: span 12;
    }

    .bento-zodiac-grid-full {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
        padding: 1rem 0;
    }

    .bento-tile-small,
    .bento-tile-medium,
    .bento-tile-large,
    .bento-tile-wide,
    .bento-tile-full,
    .bento-tile-hero,
    .bento-tile-zodiac-full {
        grid-column: span 6;
        min-height: 240px;
    }

    .bento-tile {
        padding: 1.5rem;
    }

    .bento-tile-icon {
        font-size: 2.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

    .bento-tile-title {
        font-size: 1.5rem;
    }

    .bento-tile-link {
        min-height: 44px;
    }

    .bento-action-item {
        min-height: 44px;
        min-width: 44px;
    }

    .bento-tile.clickable {
        touch-action: manipulation;
    }

    .bento-zodiac-item {
        padding: 1rem;
    }

    .bento-zodiac-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.75rem;
    }

    .bento-zodiac-grid-full {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .bento-zodiac-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .bento-actions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        gap: 1.25rem;
    }

    .bento-tile {
        padding: 1.75rem;
    }

    .bento-tile-icon {
        width: 3rem;
        height: 3rem;
        font-size: 3rem;
    }

    .bento-tile-title {
        font-size: 1.625rem;
    }

    .bento-zodiac-grid-full {
        grid-template-columns: repeat(3, 1fr);
    }

    .bento-tile-pattern {
        display: none;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bento-tile-small,
    .bento-tile-medium,
    .bento-tile-large,
    .bento-tile-wide,
    .bento-tile-full,
    .bento-tile-hero,
    .bento-tile-zodiac-full {
        grid-column: span 1;
        min-height: 200px;
    }

    .bento-zodiac-item {
        min-height: 44px;
    }

    .bento-action-item {
        padding: 0.875rem;
    }

    .bento-stat-value {
        font-size: 2.5rem;
    }

    .bento-zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 320px) {
    .bento-grid {
        gap: 0.75rem;
    }

    .bento-tile {
        padding: 1.25rem;
    }

    .bento-tile-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 2.5rem;
    }

    .bento-tile-title {
        font-size: 1.375rem;
    }

    .bento-zodiac-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Image Optimization */
.bento-tile img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Dark Mode Enhancements */
[data-theme="dark"] .bento-tile {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bento-tile:hover {
    border-color: rgba(107, 70, 193, 0.5);
    box-shadow: var(--velora-shadow-lg), 0 0 40px rgba(107, 70, 193, 0.2);
}

[data-theme="dark"] .bento-tile-featured {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.2) 0%, rgba(59, 130, 246, 0.15) 100%);
}

[data-theme="dark"] .bento-zodiac-item,
[data-theme="dark"] .bento-action-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bento-zodiac-item:hover,
[data-theme="dark"] .bento-action-item:hover {
    background: rgba(107, 70, 193, 0.2);
    border-color: rgba(107, 70, 193, 0.5);
}

/* Animation Utilities */
@keyframes bento-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bento-tile {
    animation: bento-fade-in 0.5s ease-out;
}

.bento-tile:nth-child(1) { animation-delay: 0.05s; }
.bento-tile:nth-child(2) { animation-delay: 0.1s; }
.bento-tile:nth-child(3) { animation-delay: 0.15s; }
.bento-tile:nth-child(4) { animation-delay: 0.2s; }
.bento-tile:nth-child(5) { animation-delay: 0.25s; }
.bento-tile:nth-child(6) { animation-delay: 0.3s; }
.bento-tile:nth-child(7) { animation-delay: 0.35s; }
.bento-tile:nth-child(8) { animation-delay: 0.4s; }

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .bento-tile,
    .bento-tile::before,
    .bento-tile-icon,
    .bento-tile-link,
    .bento-zodiac-item,
    .bento-action-item {
        animation: none;
        transition: none;
    }

    .bento-tile:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .bento-grid {
        display: block;
    }

    .bento-tile {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
