/**
 * Frontend styles for Social Designer by JAURIA
 */

.sdj-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sdj-generator-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sdj-form-section {
    margin-bottom: 30px;
}

.sdj-form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.sdj-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sdj-post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sdj-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.sdj-post-card.selected {
    border: 2px solid #0073aa;
    box-shadow: 0 4px 20px rgba(0,115,170,0.3);
}

.sdj-post-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.sdj-post-card-content {
    padding: 15px;
}

.sdj-post-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

.sdj-post-category {
    background: #0073aa;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sdj-format-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.sdj-format-option {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sdj-format-option:hover {
    border-color: #0073aa;
}

.sdj-format-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.sdj-format-option input {
    display: none;
}

.sdj-format-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.sdj-format-dimensions {
    color: #666;
    font-size: 14px;
}

.sdj-template-selector select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.sdj-generate-button {
    background: linear-gradient(135deg, #0073aa, #005a8b);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,115,170,0.3);
}

.sdj-generate-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a8b, #0073aa);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,115,170,0.4);
}

.sdj-generate-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sdj-result-section {
    margin-top: 40px;
    text-align: center;
}

.sdj-generated-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.sdj-download-button {
    display: inline-block;
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sdj-download-button:hover {
    background: #218838;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.sdj-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.sdj-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: sdj-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

.sdj-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

.sdj-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 20px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .sdj-frontend-container {
        padding: 15px;
    }
    
    .sdj-generator-form {
        padding: 20px;
    }
    
    .sdj-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .sdj-format-selector {
        grid-template-columns: 1fr;
    }
    
    .sdj-generate-button {
        width: 100%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .sdj-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .sdj-post-card img {
        height: 200px;
    }
}