/**
 * SharpCompress WordPress Plugin Styles
 */

/* CSS Variables */
:root {
    --brand-green: #00C853;
    --brand-green-light: #4DD0E1;
    --brand-green-dark: #00A043;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* Container */
.sharpcompress-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Header */
.sharpcompress-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-light) 100%);
    border-radius: var(--radius);
    color: white;
}

.sharpcompress-title {
    font-size: 3rem;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.sharpcompress-brand {
    color: var(--brand-green-light);
}

.sharpcompress-subtitle {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
}

/* Sections */
.sharpcompress-section {
    margin-bottom: 30px;
}

/* Cards */
.sharpcompress-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.sharpcompress-card h2 {
    color: var(--text-dark);
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.sharpcompress-card h3 {
    color: var(--text-dark);
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background: var(--brand-green);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: var(--brand-green-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--brand-green);
    padding: 12px 24px;
    border: 2px solid var(--brand-green);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--brand-green);
    color: white;
}

.btn-payment {
    background: var(--brand-green);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-payment:hover {
    background: var(--brand-green-dark);
    transform: translateY(-1px);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--brand-green);
    background-color: rgba(0, 200, 83, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
}

.upload-area p {
    margin: 0 0 20px 0;
    color: var(--text-light);
}

.upload-info {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 20px !important;
}

/* Upload Progress */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--brand-green);
    width: 0%;
    transition: width 0.3s ease;
}

/* Quality Slider */
.quality-slider {
    margin-bottom: 20px;
}

.quality-slider label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-dark);
}

#quality-range {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    outline: none;
    border-radius: 4px;
    margin-bottom: 10px;
}

#quality-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--brand-green);
    border-radius: 50%;
    cursor: pointer;
}

#quality-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--brand-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
}

.quality-description {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

/* Size Estimation */
.size-estimation {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.estimation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.estimation-grid > div {
    text-align: center;
}

.estimation-grid span {
    display: block;
    color: var(--text-light);
    font-size: 14px;
}

.estimation-grid div div {
    font-weight: 600;
    font-size: 16px;
    margin-top: 5px;
}

.reduction-info {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}

.reduction-info span:last-child {
    font-weight: 600;
    color: var(--brand-green);
}

/* Image Comparison */
.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.image-preview h3 {
    text-align: center;
    margin-bottom: 15px;
}

.image-container {
    width: 100%;
    height: 300px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
}

/* Processing Indicator */
.processing-indicator {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--brand-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Download Section */
.download-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.download-details h3 {
    margin-bottom: 10px;
}

.download-details p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.savings-info {
    font-size: 14px;
    color: var(--text-light);
}

.savings-info span {
    font-weight: 600;
    color: var(--brand-green);
}

.download-action {
    text-align: center;
}

.price-display {
    margin-bottom: 20px;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--brand-green);
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.image-thumbnail {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-thumbnail:hover,
.image-thumbnail.active {
    border-color: var(--brand-green);
    background: rgba(0, 200, 83, 0.05);
}

.image-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.image-thumbnail .filename {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-word;
}

.image-thumbnail .status {
    font-size: 12px;
    color: var(--text-light);
}

/* User Images List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-images-list {
    min-height: 200px;
}

.image-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.image-item:hover {
    box-shadow: var(--shadow);
}

.image-details {
    flex: 1;
}

.image-details h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
}

.image-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.image-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-ready { background: #e8f5e8; color: #2e7d32; }
.status-processing { background: #fff3e0; color: #f57c00; }
.status-pending { background: #e3f2fd; color: #1976d2; }
.status-failed { background: #ffebee; color: #d32f2f; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.close-btn:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 30px;
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.order-summary {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.image-name {
    font-size: 12px;
    color: var(--text-light);
    word-break: break-word;
}

.order-price {
    font-weight: 600;
    font-size: 16px;
}

.payment-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.payment-actions .btn-secondary,
.payment-actions .btn-payment {
    flex: 1;
}

.payment-terms {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin-top: 20px;
    line-height: 1.4;
}

/* Messages */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow);
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.message.success { background: #4caf50; }
.message.error { background: #f44336; }
.message.warning { background: #ff9800; }
.message.info { background: #2196f3; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading-indicator .spinner {
    margin: 0 auto 20px;
}

/* Login Page Styles */
.login-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.login-benefits {
    margin: 30px 0;
    text-align: left;
}

.login-benefits ul {
    list-style: none;
    padding: 0;
}

.login-benefits li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.login-benefits li:last-child {
    border-bottom: none;
}

.login-actions {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pricing-info {
    margin-top: 40px;
}

.price-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 30px;
    margin-top: 20px;
}

.price-card .price {
    font-size: 3rem;
    font-weight: bold;
    color: var(--brand-green);
    margin-bottom: 5px;
}

.price-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

.price-features {
    list-style: none;
    padding: 0;
    text-align: left;
}

.price-features li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.price-features li:last-child {
    border-bottom: none;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--brand-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin: 0 auto 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sharpcompress-container {
        padding: 10px;
    }
    
    .sharpcompress-header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    .sharpcompress-title {
        font-size: 2rem;
    }
    
    .sharpcompress-card {
        padding: 20px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .download-info {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .estimation-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .image-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .image-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .payment-actions {
        flex-direction: column;
    }
    
    .login-actions {
        flex-direction: column;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
}