/**
 * Custom Card Widget Styles - Centered Text Layout
 */

.custom-card-wrapper {
    display: inline-block;
    margin: 10px;
}

.custom-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: inherit;
}

.custom-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.custom-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.custom-card:hover .custom-card-image img {
    transform: scale(1.05);
}

.custom-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.custom-card:hover .custom-card-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.custom-card-content {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 90%;
}

.custom-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.custom-card-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.custom-card:hover .custom-card-title,
.custom-card:hover .custom-card-description {
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-card-wrapper {
        margin: 5px;
    }
    
    .custom-card-content {
        padding: 15px;
    }
    
    .custom-card-title {
        font-size: 16px;
    }
    
    .custom-card-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .custom-card-content {
        padding: 12px;
    }
    
    .custom-card-title {
        font-size: 15px;
    }
    
    .custom-card-description {
        font-size: 12px;
    }
}

/* Accessibility */
.custom-card:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.custom-card:focus:not(:focus-visible) {
    outline: none;
}

/* Loading state */
.custom-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading 2s linear infinite;
    opacity: 0.1;
}

@keyframes loading {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

/* Elementor specific styles */
.elementor-widget-custom-card-widget .custom-card-wrapper {
    width: 100%;
    text-align: center;
}

.elementor-widget-custom-card-widget .custom-card {
    display: inline-block;
    vertical-align: top;
}

/* Print styles */
@media print {
    .custom-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .custom-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .custom-card-overlay {
        background: rgba(0, 0, 0, 0.8) !important;
    }
    
    .custom-card-title,
    .custom-card-description {
        color: #ffffff !important;
    }
}

/* Animation classes */
.custom-card-image-loaded {
    animation: fadeIn 0.3s ease-in-out;
}

.custom-card-image-error {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-card-image-error::after {
    content: '🖼️';
    font-size: 24px;
    opacity: 0.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .custom-card-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .custom-card-title,
    .custom-card-description {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .custom-card,
    .custom-card-image img,
    .custom-card-overlay,
    .custom-card-title,
    .custom-card-description {
        transition: none;
    }
    
    .custom-card:hover {
        transform: none;
    }
    
    .custom-card:hover .custom-card-image img {
        transform: none;
    }
    
    .custom-card:hover .custom-card-title,
    .custom-card:hover .custom-card-description {
        transform: none;
    }
} 