/* Digital Ad Maker Custom Styles */

body {
    font-family: 'Inter', sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Enhanced form styling */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Ad Preview Styling */
.ad-preview-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.ad-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>') repeat;
    opacity: 0.1;
}

.ad-preview-content {
    position: relative;
    z-index: 1;
}

.ad-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ad-business-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 16px;
}

.ad-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 16px;
    opacity: 0.9;
}

.ad-features {
    margin-bottom: 20px;
}

.ad-features ul {
    list-style: none;
    padding: 0;
}

.ad-features li {
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
}

.ad-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1.1em;
}

.ad-contact {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.ad-offer {
    background: linear-gradient(45deg, #ef4444, #f59e0b);
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.ad-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.ad-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Image preview styling */
.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    group: hover;
}

.image-preview-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-preview-item:hover .image-preview-img {
    transform: scale(1.05);
}

.image-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.image-preview-item:hover .image-remove-btn {
    opacity: 1;
}

.image-remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* Modal styling enhancements */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Loading animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Responsive enhancements */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .ad-title {
        font-size: 1.5rem;
    }
    
    .ad-business-name {
        font-size: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .ad-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Category specific colors */
.ad-real-estate { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.ad-cosmetics { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.ad-hotel { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.ad-food { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.ad-fashion { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.ad-electronics { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.ad-automotive { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.ad-health { background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); }
.ad-education { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.ad-services { background: linear-gradient(135deg, #e0c3fc 0%, #9bb5ff 100%); }

/* Animation for form validation */
.form-error {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success states */
.form-success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Social Media Button Styles */
.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-btn:hover::before {
    left: 100%;
}

/* Download button styling */
#downloadAdBtn {
    position: relative;
    overflow: hidden;
}

#downloadAdBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#downloadAdBtn:hover::before {
    left: 100%;
}

#downloadAdBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Social sharing section */
#socialSharingSection {
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

#socialSharingSection:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

/* Canvas styling for ad image generation */
.ad-canvas {
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* AI Mode Styling */
.ai-mode-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-form-field {
    transition: all 0.3s ease;
}

.ai-form-field:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

#generateAiAd {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#generateAiAd:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

#generateAiAd::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

#generateAiAd:hover::before {
    left: 100%;
}

/* AI Toggle Switch Animation */
#aiModeToggle:checked + div {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

#aiModeToggle:checked + div::after {
    transform: translateX(100%);
}

/* AI Loading Animation */
.ai-generating {
    background: linear-gradient(-45deg, #8b5cf6, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 400% 400%;
    animation: ai-gradient 2s ease infinite;
}

@keyframes ai-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced Social Media Content Display */
.social-content-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.social-content-preview:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

/* Social media optimized ad formats */
.ad-preview-card {
    max-width: 600px; /* Optimal for most social media platforms */
    margin: 0 auto;
    min-height: 400px; /* Good aspect ratio for sharing */
}

/* Platform-specific optimizations */
.social-media-optimized {
    aspect-ratio: 16/9; /* Good for Facebook and X */
}

.instagram-optimized {
    aspect-ratio: 1/1; /* Square format for Instagram */
}

/* Enhanced social sharing section animations */
.social-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.social-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Pulse animation for download button */
@keyframes pulse-download {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

#downloadAdBtn:hover {
    animation: pulse-download 2s infinite;
}

/* Social platform branding colors */
.social-btn.facebook { background: linear-gradient(135deg, #1877f2, #0d5cb5); }
.social-btn.instagram { background: linear-gradient(135deg, #e4405f, #833ab4, #fd1d1d, #fcb045); }
.social-btn.whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }
.social-btn.telegram { background: linear-gradient(135deg, #0088cc, #006699); }
.social-btn.twitter { background: linear-gradient(135deg, #000000, #333333); }

/* WhatsApp specific styling */
#shareToWhatsApp {
    position: relative;
}

#shareToWhatsApp::after {
    content: '💬';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* WhatsApp modal styling */
.whatsapp-option {
    transition: all 0.3s ease;
}

.whatsapp-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

/* Status preview styling */
.whatsapp-status-preview {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.whatsapp-message-preview {
    background: #e7ffdb;
    border-left: 4px solid #25d366;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

/* WhatsApp animations */
@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#shareToWhatsApp:hover {
    animation: whatsapp-pulse 2s infinite;
}

/* Social Login Button Styling */
.social-login-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-login-btn.connected {
    position: relative;
}

.social-login-btn.connected::after {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    background: #10b981;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.social-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-login-btn:hover::before {
    left: 100%;
}

/* Direct posting indicators */
.posting-indicator {
    position: relative;
}

.posting-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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