/* Card with Grid Pattern Component - EXACT implementation from card-with-grid.md */

/* Grid Pattern Card Styles */
.grid-pattern-card {
    border: 1px solid #e2e8f0;
    width: 100%;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #ffffff;
    padding: 0.75rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: cardFadeIn 0.8s ease-out forwards;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .grid-pattern-card {
        background-color: #1a1a1a;
        border-color: #374151;
        color: #ffffff;
    }
}

/* Grid Pattern Background - EXACT from spec */
.grid-pattern-background {
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    background-size: 30px 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 800 800%22%3E%3Cg stroke-width=%223.5%22 stroke=%22hsla(215, 16%25, 47%25, 1.00)%22 fill=%22none%22%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%220%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%220%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%220%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%22400%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%22400%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%22400%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%22800%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%22800%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%22800%22 fill=%22hsla(215, 16%25, 47%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
}

/* Dark mode grid pattern */
@media (prefers-color-scheme: dark) {
    .grid-pattern-background {
        background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 800 800%22%3E%3Cg stroke-width=%223.5%22 stroke=%22hsla(0, 0%25, 100%25, 1.00)%22 fill=%22none%22%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%220%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%220%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%220%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%220%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%22400%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%22400%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%22400%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%22400%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%220%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%220%22 cy=%22800%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22400%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22400%22 cy=%22800%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3Crect width=%22400%22 height=%22400%22 x=%22800%22 y=%22800%22 opacity=%220.15%22%3E%3C/rect%3E%3Ccircle r=%2210.85%22 cx=%22800%22 cy=%22800%22 fill=%22hsla(0, 0%25, 100%25, 1.00)%22 stroke=%22none%22%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
    }
}

/* Grid Pattern Gradient Overlay - EXACT from spec */
.grid-pattern-gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
}

/* Dark mode gradient */
@media (prefers-color-scheme: dark) {
    .grid-pattern-gradient {
        background: linear-gradient(to top right, 
            rgba(26, 26, 26, 0.9) 0%, 
            rgba(26, 26, 26, 0.4) 50%, 
            rgba(26, 26, 26, 0.1) 100%);
    }
}

/* Card Body Styles */
.grid-pattern-card-body {
    text-align: left;
    padding: 1rem;
}

@media (min-width: 768px) {
    .grid-pattern-card-body {
        padding: 1.5rem;
    }
}

/* Typography */
.grid-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1f2937;
    line-height: 1.4;
}

.grid-card-text {
    font-size: 0.875rem;
    color: rgba(31, 41, 55, 0.6);
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
}

/* Dark mode typography */
@media (prefers-color-scheme: dark) {
    .grid-card-title {
        color: #ffffff;
    }
    
    .grid-card-text {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Animation Keyframes */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Animation for Multiple Cards */
.grid-pattern-card:nth-child(1) {
    animation-delay: 0s;
}

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

.grid-pattern-card:nth-child(3) {
    animation-delay: 0.4s;
}

.grid-pattern-card:nth-child(4) {
    animation-delay: 0.6s;
}

.grid-pattern-card:nth-child(5) {
    animation-delay: 0.8s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid-pattern-card {
        padding: 0.5rem;
    }
    
    .grid-pattern-card-body {
        padding: 0.75rem;
    }
    
    .grid-card-title {
        font-size: 1rem;
    }
    
    .grid-card-text {
        font-size: 0.8rem;
    }
    
    .grid-pattern-background {
        background-size: 20px 20px;
    }
}

/* Hover Effects */
.grid-pattern-card:hover .grid-pattern-background {
    animation: gridShift 2s ease-in-out infinite;
}

@keyframes gridShift {
    0%, 100% {
        background-position: 0 0;
    }
    50% {
        background-position: 15px 15px;
    }
}

/* Focus States for Accessibility */
.grid-pattern-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .grid-pattern-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .grid-pattern-background {
        background-image: none;
    }
    
    .grid-pattern-gradient {
        background: none;
    }
}
