/**
 * DeyWithMe Tools - Base Styles
 * Lightweight, mobile-first styling for tool display
 */

/* Tool Wrapper */
.dwm-tool-wrapper {
    margin: 20px 0;
    padding: 0;
    clear: both;
}

/* Tool Content */
.dwm-tool-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

/* Descriptions */
.dwm-tool-description {
    margin: 20px 0;
    line-height: 1.6;
}

.dwm-tool-description-above {
    margin-bottom: 25px;
}

.dwm-tool-description-below {
    margin-top: 25px;
}

/* Ad Slots */
.dwm-tool-ad {
    margin: 20px 0;
    text-align: center;
    min-height: 50px;
}

.dwm-tool-ad-above {
    margin-bottom: 20px;
}

.dwm-tool-ad-below {
    margin-top: 20px;
}

/* Lead Generation Box */
.dwm-tool-lead-gen {
    margin-top: 20px;
}

.dwm-lead-gen-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.dwm-lead-gen-box h4 {
    margin-top: 0;
    color: #212529;
}

.dwm-lead-form {
    margin-top: 15px;
}

.dwm-lead-form input[type="email"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
}

.dwm-lead-submit {
    background: #007bff;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dwm-lead-submit:hover {
    background: #0056b3;
}

.dwm-lead-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.dwm-lead-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dwm-lead-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error Messages */
.dwm-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
}

/* Input Validation Errors */
.dwm-validation-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

input.dwm-invalid,
select.dwm-invalid,
textarea.dwm-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dwm-tool-content {
        padding: 15px;
    }
    
    .dwm-lead-gen-box {
        padding: 20px 15px;
    }
    
    .dwm-lead-form input[type="email"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Loading State */
.dwm-tool-loading {
    opacity: 0.6;
    pointer-events: none;
}

.dwm-tool-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: dwm-spin 1s linear infinite;
}

@keyframes dwm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .dwm-tool-ad,
    .dwm-tool-lead-gen {
        display: none !important;
    }
}

/* Social Sharing Buttons */
.dwm-social-share {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.dwm-share-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.dwm-share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dwm-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.dwm-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dwm-share-facebook {
    background: #1877f2;
    color: #fff;
}

.dwm-share-twitter {
    background: #1da1f2;
    color: #fff;
}

.dwm-share-linkedin {
    background: #0077b5;
    color: #fff;
}

.dwm-share-whatsapp {
    background: #25d366;
    color: #fff;
}

.dwm-share-email {
    background: #666;
    color: #fff;
}

/* Related Tools */
.dwm-related-tools {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dwm-related-tools h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #212529;
}

.dwm-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.dwm-related-item {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.dwm-related-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dwm-related-item .related-thumb {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.dwm-related-item .related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dwm-related-item h4 {
    margin: 15px;
    font-size: 18px;
}

.dwm-related-item h4 a {
    color: #212529;
    text-decoration: none;
}

.dwm-related-item h4 a:hover {
    color: #007bff;
}

.dwm-related-item p {
    margin: 0 15px 15px;
    color: #666;
    font-size: 14px;
}

/* Widget Styles */
.dwm-widget-tools {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dwm-widget-tools li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.dwm-widget-tools li:last-child {
    border-bottom: none;
}

.dwm-widget-tools a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.dwm-widget-tools a:hover {
    color: #007bff;
}

/* Enhanced Print Styles */
@media print {
    body {
        font-size: 12pt;
        color: #000;
    }
    
    .dwm-tool-wrapper {
        page-break-inside: avoid;
    }
    
    .dwm-tool-content {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .dwm-social-share,
    .dwm-related-tools,
    .dwm-tool-ad,
    .dwm-tool-lead-gen {
        display: none !important;
    }
    
    .dwm-tool-description {
        page-break-inside: avoid;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .dwm-tool-wrapper {
        margin: 0;
    }
}

/* Result History Notification */
.dwm-history-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Embed Code Display */
.dwm-embed-code {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.dwm-embed-code h4 {
    margin-top: 0;
}

.dwm-embed-code textarea {
    width: 100%;
    min-height: 100px;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dwm-embed-copy-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.dwm-embed-copy-btn:hover {
    background: #0056b3;
}