/**
 * PhotoDeals WordPress Plugin Styles
 * Professional styling for deal displays
 */

/* Fallback Notice */
.photodeals-fallback-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.5s ease-in;
}

.photodeals-fallback-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.photodeals-fallback-text {
    flex: 1;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Layout */
.photodeals-card {
    max-width: 600px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.photodeals-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Image Section */
.photodeals-image {
    position: relative;
    overflow: hidden;
}

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

.photodeals-card:hover .photodeals-image img {
    transform: scale(1.05);
}

.photodeals-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Content Section */
.photodeals-content {
    padding: 20px;
}

.photodeals-category {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.photodeals-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.photodeals-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.photodeals-description strong {
    color: #2d3748;
    font-weight: 600;
}

.photodeals-description ul {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

.photodeals-description li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 4px;
}

.photodeals-description li::before {
    content: "•";
    color: #48bb78;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Pricing Section */
.photodeals-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.photodeals-discount-price {
    font-size: 24px;
    font-weight: 700;
    color: #48bb78;
}

.photodeals-original-price {
    font-size: 16px;
    color: #a0aec0;
    text-decoration: line-through;
}

/* Countdown Timer */
.photodeals-countdown {
    background: linear-gradient(135deg, #ffeaa7 0%, #ffd32a 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.photodeals-countdown-title {
    font-size: 11px;
    font-weight: 600;
    color: #856404;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

.photodeals-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.photodeals-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 6px 8px;
    min-width: 45px;
    flex: 0 1 auto;
}

.photodeals-countdown-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.photodeals-countdown-label {
    font-size: 9px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    margin-top: 3px;
    letter-spacing: 0.3px;
}

.photodeals-countdown-separator {
    font-size: 18px;
    font-weight: 700;
    color: #856404;
    line-height: 1;
}

.photodeals-countdown-urgent {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse-urgent 1s ease-in-out infinite;
}

.photodeals-countdown-urgent .photodeals-countdown-title,
.photodeals-countdown-urgent .photodeals-countdown-separator {
    color: white;
}

.photodeals-countdown-expired {
    text-align: center;
    font-weight: 600;
    color: #721c24;
    padding: 8px;
}

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

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

/* Coupon Section */
.photodeals-coupon {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.photodeals-coupon-label {
    font-size: 12px;
    font-weight: 600;
    color: #856404;
    text-transform: uppercase;
}

.photodeals-coupon-code {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
}

.photodeals-copy-coupon {
    background: #ffc107;
    border: none;
    color: #212529;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.photodeals-copy-coupon:hover {
    background: #e0a800;
}

/* Bonus Items */
.photodeals-bonus-items {
    background: #f7fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.photodeals-bonus-items h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.photodeals-bonus-items ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.photodeals-bonus-items li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #4a5568;
}

.photodeals-bonus-items li::before {
    content: "✓";
    color: #48bb78;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.photodeals-bonus-value {
    color: #48bb78;
    font-size: 12px;
    font-weight: 600;
}

.photodeals-bonus-items p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #718096;
}

/* CTA Button */
.photodeals-cta-button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 12px;
}

.photodeals-cta-button:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Merchant */
.photodeals-merchant {
    text-align: center;
    font-size: 12px;
    color: #a0aec0;
}

/* Banner Layout */
.photodeals-banner {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 600px;
    margin: 20px auto;
}

.photodeals-banner .photodeals-image {
    flex: 0 0 200px;
}

.photodeals-banner .photodeals-image img {
    height: 100%;
    width: 100%;
}

.photodeals-banner .photodeals-content {
    flex: 1;
    padding: 20px;
}

/* Compact Layout */
.photodeals-compact {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin: 15px auto;
    max-width: 500px;
}

.photodeals-compact .photodeals-image {
    flex: 0 0 80px;
    margin-right: 16px;
}

.photodeals-compact .photodeals-image img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

.photodeals-compact .photodeals-content {
    flex: 1;
    padding: 0;
}

.photodeals-compact .photodeals-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.photodeals-compact .photodeals-pricing {
    margin-bottom: 8px;
}

.photodeals-compact .photodeals-cta-button {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Responsive Design - Phone, Tablet, Desktop */

/* Desktop (1025px and above) */
@media (min-width: 1025px) {
    .photodeals-card {
        max-width: 600px;
    }
    
    .photodeals-banner {
        max-width: 700px;
    }
    
    .photodeals-compact {
        max-width: 500px;
    }
}

/* Tablet (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .photodeals-card {
        max-width: 90%;
        min-width: 500px;
    }
    
    .photodeals-banner {
        max-width: 90%;
        min-width: 500px;
    }
    
    .photodeals-compact {
        max-width: 90%;
    }
}

/* Narrow spaces (sidebars, widget areas) - 350px and below */
@media (max-width: 350px) {
    .photodeals-card,
    .photodeals-banner,
    .photodeals-compact {
        margin: 10px 0;
    }
    
    .photodeals-content {
        padding: 12px !important;
    }
    
    .photodeals-title {
        font-size: 16px !important;
    }
    
    .photodeals-description {
        font-size: 13px;
    }
    
    .photodeals-image img {
        height: 180px !important;
    }
    
    .photodeals-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 12px !important;
    }
    
    .photodeals-discount-price {
        font-size: 18px !important;
    }
    
    .photodeals-original-price {
        font-size: 14px !important;
    }
    
    /* Compact countdown for narrow spaces */
    .photodeals-countdown {
        padding: 10px;
    }
    
    .photodeals-countdown-title {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .photodeals-countdown-timer {
        gap: 3px;
    }
    
    .photodeals-countdown-item {
        padding: 5px 6px;
        min-width: 38px;
    }
    
    .photodeals-countdown-value {
        font-size: 14px;
    }
    
    .photodeals-countdown-label {
        font-size: 8px;
        margin-top: 2px;
    }
    
    .photodeals-countdown-separator {
        font-size: 14px;
        display: none; /* Hide separators in very narrow spaces */
    }
    
    .photodeals-coupon {
        padding: 10px;
        font-size: 12px;
    }
    
    .photodeals-coupon-code {
        font-size: 12px;
    }
    
    .photodeals-cta-button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .photodeals-banner {
        flex-direction: column;
    }
    
    .photodeals-banner .photodeals-image {
        flex: none;
        height: 180px;
    }
}

/* Phone (768px and below) */
@media (max-width: 768px) {
    .photodeals-card {
        max-width: 100%;
        margin: 15px 0;
    }
    
    .photodeals-banner {
        flex-direction: column;
        max-width: 100%;
    }
    
    .photodeals-banner .photodeals-image {
        flex: none;
        height: 200px;
    }
    
    .photodeals-compact {
        max-width: 100%;
    }
    
    .photodeals-coupon {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .photodeals-title {
        font-size: 18px;
    }
    
    .photodeals-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .photodeals-discount-price {
        font-size: 20px;
    }
}

/* Error and Placeholder States */
.photodeals-placeholder,
.photodeals-error {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 20px 0;
}

.photodeals-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Loading State */
.photodeals-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.photodeals-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: photodeals-spin 1s linear infinite;
}

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

/* Accessibility */
.photodeals-cta-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.photodeals-copy-coupon:focus {
    outline: 2px solid #ffc107;
    outline-offset: 1px;
}

/* Print Styles */
@media print {
    .photodeals-card,
    .photodeals-banner,
    .photodeals-compact {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .photodeals-cta-button {
        background: #6c757d !important;
    }
}