/**
 * WP Detector Styles
 * Main stylesheet for WordPress theme and plugin detector
 */

/* Reset and Base Styles */
.wp-detector-wrapper * {
    box-sizing: border-box;
}

.wp-detector-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
.wp-detector-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.wp-detector-title {
    color: #26968F;
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(38, 150, 143, 0.1);
}

.wp-detector-subtitle {
    color: #666;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
}

/* Form Styles */
.wp-detector-form-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid rgba(38, 150, 143, 0.1);
}

.wp-detector-input-group {
    margin-bottom: 0;
}

.wp-detector-input-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: stretch;
}

.wp-detector-input {
    flex: 1;
    padding: 18px 24px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.wp-detector-input:focus {
    outline: none;
    border-color: #26968F;
    background: white;
    box-shadow: 0 0 0 4px rgba(38, 150, 143, 0.1);
    transform: translateY(-1px);
}

.wp-detector-input::placeholder {
    color: #999;
    font-weight: 400;
}

.wp-detector-submit-btn {
    background: linear-gradient(135deg, #26968F 0%, #1e7a73 100%);
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(38, 150, 143, 0.3);
}

.wp-detector-submit-btn:hover {
    background: linear-gradient(135deg, #1e7a73 0%, #165d57 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 150, 143, 0.4);
}

.wp-detector-submit-btn:active {
    transform: translateY(0);
}

.wp-detector-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wp-detector-submit-btn .btn-text {
    font-weight: 600;
}

.wp-detector-submit-btn .btn-loader {
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner .path {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Image Loading States */
.theme-screenshot img,
.plugin-icon img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-screenshot img.loaded,
.plugin-icon img.loaded {
    opacity: 1;
}

/* Improved Image Fallbacks */
.theme-screenshot .no-image,
.plugin-icon .default-icon {
    transition: all 0.3s ease;
}

.theme-screenshot .no-image:hover,
.plugin-icon .default-icon:hover {
    background: #e9ecef;
}

.wp-detector-form-help {
    text-align: center;
}

.wp-detector-form-help small {
    color: #666;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Results Styles */
.wp-detector-results {
    margin-top: 40px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-detector-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 5px;
}

.results-title {
    color: #26968F;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 12px;
}

.export-btn {
    background: white;
    border: 2px solid #26968F;
    color: #26968F;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.export-btn:hover {
    background: #26968F;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 150, 143, 0.3);
}

.export-btn .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.export-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Status Card Styles */
.wp-detector-website-status {
    margin-bottom: 30px;
}

.status-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 25px;
    transition: transform 0.3s ease;
    border: 1px solid #f0f0f0;
}

.status-card:hover {
    transform: translateY(-2px);
}

.status-card.wordpress {
    border-left: 6px solid #26968F;
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
}

.status-card.not-wordpress {
    border-left: 6px solid #d63638;
    background: linear-gradient(135deg, #ffffff 0%, #fef8f8 100%);
}

.status-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
}

.status-icon svg {
    width: 56px;
    height: 56px;
}

.status-content {
    flex: 1;
}

.status-title {
    color: #333;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.status-description {
    color: #666;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Detection Section Styles */
.wp-detector-details {
    display: grid;
    gap: 25px;
}

.detection-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease;
}

.detection-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.section-title {
    color: #26968F;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Theme Styles */
.theme-card {
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfc;
    margin-bottom: 20px;
}

.theme-info {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.theme-screenshot {
    flex-shrink: 0;
    width: 280px;
    max-width: 100%;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    aspect-ratio: 4/3;
    position: relative;
}

.theme-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.theme-screenshot img.loaded {
    opacity: 1;
}

.theme-screenshot img:hover {
    transform: scale(1.02);
}

.theme-screenshot .no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    box-sizing: border-box;
}

.theme-details {
    flex: 1;
    padding: 25px;
}

.theme-name {
    color: #333;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.theme-meta {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.theme-meta p {
    margin: 0 0 8px 0;
}

.theme-status {
    font-weight: 600;
    color: #26968F;
}

.theme-version,
.theme-author {
    font-size: 0.95rem;
}

.theme-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Plugin Styles */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.plugin-card {
    background: #fafbfc;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.plugin-card:hover {
    background: white;
    border-color: #26968F;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(38, 150, 143, 0.1);
}

.plugin-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e5e9;
    position: relative;
}

.plugin-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease, opacity 0.3s ease;
    opacity: 0;
    border-radius: 6px;
}

.plugin-icon img.loaded {
    opacity: 1;
}

.plugin-icon img:hover {
    transform: scale(1.05);
}

.plugin-icon .default-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
}

.plugin-icon .default-icon svg {
    width: 32px;
    height: 32px;
}

.plugin-info {
    flex: 1;
    min-width: 0;
}

.plugin-name {
    color: #333;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    word-wrap: break-word;
}

.plugin-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.plugin-meta p {
    margin: 0 0 4px 0;
}

.plugin-status {
    font-weight: 600;
    color: #26968F;
}

.plugin-version {
    color: #888;
}

.plugin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Action Button Styles */
.action-btn {
    background: #26968F;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: #1e7a73;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(38, 150, 143, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: white;
    color: #26968F;
    border: 1px solid #26968F;
}

.action-btn.secondary:hover {
    background: #26968F;
    color: white;
    border-color: #26968F;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Error Styles */
.wp-detector-error {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 1px solid #fcc;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    animation: fadeInUp 0.6s ease;
}

.error-content h4 {
    color: #d63638;
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.error-content p {
    color: #d63638;
    margin: 0;
    font-size: 1rem;
}

/* No Data Styles */
.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.font-weight-bold {
    font-weight: 600;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-20 {
    margin-top: 20px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .wp-detector-wrapper {
        padding: 20px;
        margin: 20px 0;
    }
    
    .wp-detector-header h2 {
        font-size: 1.8rem;
    }
    
    .wp-detector-title {
        font-size: 2.2rem;
    }
    
    .wp-detector-subtitle {
        font-size: 1.1rem;
    }
    
    .wp-detector-form {
        padding: 25px;
    }
    
    .wp-detector-form-section {
        padding: 25px 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .wp-detector-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .url-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .scan-btn {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
    }
    
    .wp-detector-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }
    
    .wp-detector-results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .results-title {
        font-size: 1.6rem;
        text-align: center;
    }
    
    .results-actions {
        justify-content: center;
    }
    
    .export-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
    }
    
    .status-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .status-icon {
        font-size: 3rem;
    }
    
    .status-title {
        font-size: 1.4rem;
    }
    
    .detection-section {
        padding: 25px 20px;
    }
    
    .section-title {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .theme-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .theme-screenshot {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .theme-details {
        padding: 20px;
        text-align: center;
    }
    
    .theme-actions {
        justify-content: center;
    }
    
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .plugin-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 15px;
        gap: 12px;
    }
    
    .plugin-icon {
        align-self: center;
        width: 56px;
        height: 56px;
    }
    
    .plugin-icon .default-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .plugin-actions {
        justify-content: center;
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wp-detector-wrapper {
        padding: 10px;
    }
    
    .wp-detector-title {
        font-size: 1.8rem;
    }
    
    .wp-detector-form-section {
        padding: 20px 15px;
    }
    
    .wp-detector-input {
        padding: 16px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .export-btn {
        justify-content: center;
        width: 100%;
    }
    
    .status-card {
        padding: 20px 15px;
    }
    
    .detection-section {
        padding: 20px 15px;
    }
    
    .theme-details {
        padding: 15px;
    }
    
    .plugin-card {
        padding: 15px;
    }
    
    .theme-actions,
    .plugin-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .wp-detector-form-section,
    .results-actions,
    .theme-actions,
    .plugin-actions {
        display: none;
    }
    
    .wp-detector-wrapper {
        max-width: none;
        padding: 0;
    }
    
    .status-card,
    .detection-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .wp-detector-wrapper {
        color: #e0e0e0;
    }
    
    .wp-detector-form-section,
    .status-card,
    .detection-section,
    .theme-card,
    .plugin-card {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .wp-detector-input {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .wp-detector-input:focus {
        background: #2a2a2a;
        border-color: #26968F;
    }
    
    .status-title,
    .theme-name,
    .plugin-name {
        color: #e0e0e0;
    }
    
    .status-description,
    .theme-meta,
    .plugin-meta {
        color: #b0b0b0;
    }
    
    .no-data {
        background: #333;
        color: #999;
    }
}