/**
 * File Circle AI Tools - Base Styles
 * Common styles for all AI tools
 */

/* Font Awesome Icon Fixes */
.fas,
.far,
.fab,
.fal,
.fad {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands", "Font Awesome 5 Pro" !important;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fab {
    font-family: "Font Awesome 5 Brands" !important;
    font-weight: 400;
}

.far {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 400;
}

/* Ensure icons display properly */
.fa,
.fas,
.far,
.fab,
.fal,
.fad {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Fix for broken icon URLs */
i[class*="fas fa-"]:before,
i[class*="far fa-"]:before,
i[class*="fab fa-"]:before {
    content: attr(data-icon) !important;
}

/* Common icon fixes */
.fa-dollar-sign:before {
    content: "\f155";
}

.fa-search:before {
    content: "\f002";
}

.fa-globe:before {
    content: "\f0ac";
}

.fa-file-alt:before {
    content: "\f15c";
}

.fa-link:before {
    content: "\f0c1";
}

.fa-edit:before {
    content: "\f044";
}

.fa-qrcode:before {
    content: "\f029";
}

.fa-key:before {
    content: "\f084";
}

.fa-whatsapp:before {
    content: "\f232";
}

.fa-spinner:before {
    content: "\f110";
}

.fa-check:before {
    content: "\f00c";
}

.fa-copy:before {
    content: "\f0c5";
}

.fa-eye:before {
    content: "\f06e";
}

.fa-eye-slash:before {
    content: "\f070";
}

.fa-exclamation-triangle:before {
    content: "\f071";
}

/* Base tool container */
.ai-tool-interface {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tool header */
.ai-tool-interface .tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1d9051;
}

.ai-tool-interface .tool-header h2 {
    color: #1d9051;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.ai-tool-interface .tool-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Form elements */
.ai-tool-interface .tool-form {
    margin-bottom: 20px;
}

.ai-tool-interface .form-group {
    margin-bottom: 20px;
}

.ai-tool-interface .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ai-tool-interface .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ai-tool-interface .form-control:focus {
    outline: none;
    border-color: #1d9051;
    box-shadow: 0 0 0 3px rgba(29, 144, 81, 0.1);
}

.ai-tool-interface .form-help,
.ai-tool-interface .form-text {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

/* Buttons */
.ai-tool-interface .btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.5;
}

.ai-tool-interface .btn-primary {
    background: #1d9051;
    color: white;
}

.ai-tool-interface .btn-primary:hover {
    background: #157a42;
    transform: translateY(-2px);
}

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

.ai-tool-interface .btn-secondary {
    background: #6c757d;
    color: white;
}

.ai-tool-interface .btn-secondary:hover {
    background: #545b62;
}

.ai-tool-interface .btn-success {
    background: #28a745;
    color: white;
}

.ai-tool-interface .btn-success:hover {
    background: #218838;
}

.ai-tool-interface .btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.ai-tool-interface .btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* Form actions */
.ai-tool-interface .form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-tool-interface .form-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Tool results */
.ai-tool-interface .tool-result {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1d9051;
}

.ai-tool-interface .result-header h3 {
    color: #1d9051;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Input groups */
.ai-tool-interface .input-group {
    display: flex;
}

.ai-tool-interface .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.ai-tool-interface .input-group-append {
    display: flex;
}

.ai-tool-interface .input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 12px 15px;
}

/* Error messages */
.ai-tool-interface .error-message,
.file-circle-error {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.ai-tool-interface .alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success messages */
.ai-tool-interface .alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Loading states */
.ai-tool-interface .loading {
    opacity: 0.6;
    pointer-events: none;
}

.ai-tool-interface .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-tool-interface {
        margin: 10px;
        padding: 15px;
    }

    .ai-tool-interface .tool-header h2 {
        font-size: 24px;
    }

    .ai-tool-interface .form-actions {
        flex-direction: column;
    }

    .ai-tool-interface .form-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .ai-tool-interface .input-group {
        flex-direction: column;
    }

    .ai-tool-interface .input-group .form-control {
        border-radius: 6px;
        border-right: 2px solid #e1e5e9;
        margin-bottom: 10px;
    }

    .ai-tool-interface .input-group-append .btn {
        border-radius: 6px;
        width: 100%;
    }
}

/* Animation for result appearance */
.ai-tool-interface .tool-result {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* File Circle brand colors */
.ai-tool-interface .text-primary {
    color: #1d9051 !important;
}

.ai-tool-interface .bg-primary {
    background-color: #1d9051 !important;
}

.ai-tool-interface .border-primary {
    border-color: #1d9051 !important;
}

/* WhatsApp specific styles */
.whatsapp-chat-tool {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.whatsapp-chat-tool .tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #25D366;
}

.whatsapp-chat-tool .tool-header h2 {
    color: #25D366;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.whatsapp-chat-tool .btn-primary {
    background: #25D366;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.whatsapp-chat-tool .btn-primary:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* Word Counter specific styles */
.word-counter-tool {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.word-counter-tool .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.word-counter-tool .stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid #1d9051;
}

.word-counter-tool .stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #1d9051;
}

.word-counter-tool .stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}