/**
 * App Store Version Display - Frontend Styles
 * Professional styling for retirement/pilgrimage themed websites
 * Author: Kevin Donahue
 * Version: 1.0.0
 */

/* Base App Version Display Styles */
.app-version-display {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    margin: 0.5rem 0;
    font-size: 14px;
}

/* Simple format */
.asvd-format-simple {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    color: #333;
    font-weight: 500;
}

/* Detailed format */
.asvd-format-detailed {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 320px;
}

.asvd-format-detailed .asvd-app-name {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.asvd-format-detailed .asvd-version {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.asvd-format-detailed .asvd-release-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.asvd-format-detailed .asvd-app-link {
    margin-top: 0.5rem;
}

.asvd-format-detailed .asvd-app-link a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: color 0.2s ease;
}

.asvd-format-detailed .asvd-app-link a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Badge format */
.asvd-format-badge {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.asvd-format-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.asvd-format-badge .asvd-badge-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.asvd-format-badge .asvd-version-number {
    font-weight: 600;
    font-size: 16px;
}

.asvd-format-badge .asvd-release-date {
    font-size: 12px;
    opacity: 0.9;
}

.asvd-format-badge .asvd-store-link {
    color: white;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.asvd-format-badge .asvd-store-link:hover {
    background: rgba(255,255,255,0.3);
    text-decoration: none;
}

/* Theme variations */
.asvd-theme-retirement.asvd-format-simple {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-left-color: #f39c12;
}

.asvd-theme-retirement.asvd-format-detailed {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-color: #f39c12;
}

.asvd-theme-retirement.asvd-format-detailed .asvd-app-name {
    color: #f39c12;
}

.asvd-theme-retirement.asvd-format-detailed .asvd-app-link a {
    color: #3498db;
}

.asvd-theme-retirement.asvd-format-badge {
    background: linear-gradient(45deg, #2c3e50 0%, #f39c12 100%);
}

.asvd-theme-pilgrimage.asvd-format-simple {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #f4f1e8;
    border-left-color: #daa520;
    font-family: Georgia, 'Times New Roman', serif;
}

.asvd-theme-pilgrimage.asvd-format-detailed {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #f4f1e8;
    border-color: #daa520;
    font-family: Georgia, 'Times New Roman', serif;
}

.asvd-theme-pilgrimage.asvd-format-detailed .asvd-app-name {
    color: #daa520;
}

.asvd-theme-pilgrimage.asvd-format-detailed .asvd-app-link a {
    color: #87ceeb;
}

.asvd-theme-pilgrimage.asvd-format-badge {
    background: linear-gradient(45deg, #8b4513 0%, #daa520 100%);
    font-family: Georgia, 'Times New Roman', serif;
}

/* Error states */
.app-version-error {
    color: #dc3545;
    font-style: italic;
    padding: 0.5rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 13px;
}

/* Loading states */
.asvd-loading {
    opacity: 0.7;
    position: relative;
}

.asvd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: asvd-spin 1s linear infinite;
}

@keyframes asvd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/loaded states */
.asvd-loaded {
    animation: asvd-fade-in 0.3s ease-in;
}

@keyframes asvd-fade-in {
    from { 
        opacity: 0; 
        transform: translateY(-5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .asvd-format-detailed {
        max-width: 100%;
        margin: 0.5rem 0;
    }
    
    .asvd-format-badge .asvd-badge-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .asvd-format-badge .asvd-version-number {
        font-size: 18px;
    }
}

/* Integration with common WordPress themes */
.entry-content .app-version-display,
.post-content .app-version-display,
.page-content .app-version-display {
    margin: 1rem 0;
    clear: both;
}

/* Widget styling */
.widget .app-version-display {
    margin: 0.5rem 0;
}

.widget .asvd-format-detailed {
    max-width: 100%;
}

/* Print styles */
@media print {
    .app-version-display {
        background: none !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        color: #000 !important;
    }
    
    .asvd-format-badge {
        background: none !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
    }
    
    .asvd-store-link {
        color: #000 !important;
        background: none !important;
    }
}

/* High contrast accessibility */
@media (prefers-contrast: high) {
    .app-version-display {
        border: 2px solid currentColor !important;
        background: transparent !important;
    }
    
    .asvd-format-badge {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff !important;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .asvd-loading::after {
        animation: none;
    }
    
    .asvd-loaded {
        animation: none;
    }
    
    .asvd-format-badge {
        transition: none;
    }
    
    .asvd-format-badge:hover {
        transform: none;
    }
}

/* RTL support */
.rtl .app-version-display {
    direction: rtl;
    text-align: right;
}

.rtl .asvd-format-simple {
    border-left: none;
    border-right: 4px solid #007cba;
}

.rtl .asvd-format-badge .asvd-badge-content {
    flex-direction: row-reverse;
}

/* Focus states for accessibility */
.asvd-store-link:focus,
.asvd-app-link a:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* Custom properties for easy theming */
:root {
    --asvd-primary-color: #007cba;
    --asvd-secondary-color: #f39c12;
    --asvd-text-color: #333;
    --asvd-bg-color: #f8f9fa;
    --asvd-border-color: #dee2e6;
    --asvd-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* WordPress block editor compatibility */
.wp-block .app-version-display {
    margin: 1rem 0;
}

.wp-block[data-align="center"] .app-version-display {
    text-align: center;
}

.wp-block[data-align="right"] .app-version-display {
    text-align: right;
}