/**
 * Animated Card Plugin Styles
 * Overlay Design - Content displayed above image background
 */

:root {
    --acp-primary-color: #667eea;
    --acp-secondary-color: #764ba2;
    --acp-text-color: #ffffff;
    --acp-bg-color: #ffffff;
    --acp-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --acp-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --acp-border-radius: 16px;
    --acp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --acp-overlay-opacity: 0.4;
    --acp-stats-icon-color: #ff6b9d;
}

/* Base Card Styles - Overlay Design */
.acp-card {
    position: relative;
    border-radius: var(--acp-border-radius);
    overflow: hidden;
    transition: var(--acp-transition);
    margin-bottom: 30px;
    box-shadow: var(--acp-shadow);
    min-height: 400px;
    display: flex;
    align-items: stretch;
}

.acp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--acp-shadow-hover);
}

/* Background Image Container */
.acp-card-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.acp-card-image-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--acp-transition);
}

.acp-card:hover .acp-card-image-bg img {
    transform: scale(1.05);
}

/* Gradient Overlay for Text Readability */
.acp-card-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, var(--acp-overlay-opacity)) 0%,
        rgba(0, 0, 0, calc(var(--acp-overlay-opacity) * 0.6)) 50%,
        rgba(0, 0, 0, calc(var(--acp-overlay-opacity) * 0.3)) 100%
    );
    z-index: 2;
    transition: var(--acp-transition);
}

.acp-card:hover .acp-card-overlay-gradient {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, calc(var(--acp-overlay-opacity) * 1.2)) 0%,
        rgba(0, 0, 0, calc(var(--acp-overlay-opacity) * 0.8)) 50%,
        rgba(0, 0, 0, calc(var(--acp-overlay-opacity) * 0.5)) 100%
    );
}

/* Content Overlay Container */
.acp-card-content-overlay {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px 40px;
    min-height: 400px;
}

/* Left Side Content */
.acp-card-content-left {
    max-width: 60%;
    z-index: 4;
}

.acp-card-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--acp-text-color);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: var(--acp-transition);
}

.acp-card:hover .acp-card-title {
    transform: translateX(5px);
}

.acp-card-body {
    color: var(--acp-text-color);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 16px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.acp-card-body p {
    margin: 0 0 15px 0;
}

.acp-card-body p:last-child {
    margin-bottom: 0;
}

/* Card Button */
.acp-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--acp-text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--acp-transition);
    position: relative;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.acp-card-button:hover {
    gap: 12px;
    color: var(--acp-text-color);
    transform: translateX(5px);
}

.acp-button-arrow {
    transition: var(--acp-transition);
    display: inline-block;
    font-size: 18px;
}

.acp-card-button:hover .acp-button-arrow {
    transform: translateX(5px);
}

/* Stats Overlay Card (Bottom Right) - Always visible at fixed position */
.acp-card-stats-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 140px;
    max-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 5;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.acp-stats-icon {
    width: 36px;
    height: 36px;
    background: var(--acp-stats-icon-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.acp-stats-icon i {
    font-size: 16px;
    color: #ffffff;
}

.acp-stats-label {
    font-size: 10px;
    color: var(--acp-stats-icon-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.acp-stats-value {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    line-height: 1;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.acp-stats-description {
    font-size: 10px;
    color: #666666;
    line-height: 1.3;
}

/* Style Variations */
.acp-style1 {
    /* Modern overlay style - default */
}

.acp-style2 {
    border-radius: 8px;
}

.acp-style2 .acp-card-stats-overlay {
    border-radius: 8px;
}

.acp-style3 {
    min-height: 350px;
}

.acp-style3 .acp-card-content-overlay {
    min-height: 350px;
    padding: 40px 30px;
}

.acp-style3 .acp-card-title {
    font-size: 36px;
}

.acp-style4 {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.acp-style4:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Animations */
.acp-animation-fade {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.acp-animation-slide {
    transform: translateX(-100px);
    opacity: 0;
    animation: slideIn 0.8s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.acp-animation-zoom {
    transform: scale(0.9);
    opacity: 0;
    animation: zoomIn 0.8s ease-out forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.acp-animation-flip {
    transform: perspective(1000px) rotateY(-90deg);
    opacity: 0;
    animation: flipIn 1s ease-out forwards;
}

@keyframes flipIn {
    from {
        transform: perspective(1000px) rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .acp-card-content-left {
        max-width: 70%;
    }
    
    .acp-card-title {
        font-size: 40px;
    }
    
    .acp-card-stats-overlay {
        bottom: 20px;
        right: 20px;
        padding: 20px 25px;
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .acp-card {
        min-height: 350px;
    }
    
    .acp-card-content-overlay {
        padding: 30px 25px;
        min-height: 350px;
    }
    
    .acp-card-content-left {
        max-width: 100%;
    }
    
    .acp-card-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .acp-card-body {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .acp-card-stats-overlay {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
        max-width: 100%;
        padding: 12px 16px;
    }
    
    .acp-stats-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
    }
    
    .acp-stats-icon i {
        font-size: 14px;
    }
    
    .acp-stats-label {
        font-size: 9px;
        margin-bottom: 3px;
    }
    
    .acp-stats-value {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .acp-stats-description {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .acp-card-title {
        font-size: 28px;
    }
    
    .acp-card-content-overlay {
        padding: 25px 20px;
    }
    
    .acp-card-stats-overlay {
        padding: 12px 16px;
        bottom: 15px;
        right: 15px;
        min-width: 140px;
        max-width: 180px;
    }
    
    .acp-stats-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 8px;
    }
    
    .acp-stats-icon i {
        font-size: 16px;
    }
    
    .acp-stats-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .acp-stats-value {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .acp-stats-description {
        font-size: 10px;
    }
}

/* Grid Layout Helper */
.acp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .acp-card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Loading State */
.acp-card.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Accessibility */
.acp-card:focus-within {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
}

.acp-card-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Fallback for cards without images */
.acp-card:not(:has(.acp-card-image-bg)) {
    background: linear-gradient(135deg, var(--acp-primary-color), var(--acp-secondary-color));
}

.acp-card:not(:has(.acp-card-image-bg)) .acp-card-overlay-gradient {
    display: none;
}
