/**
 * Shared styles for all Helppdev tool pages.
 * Load before tool-specific CSS overrides.
 */

/* Quick tips */
.alert-light.border h5 {
    color: var(--neutral--100);
    margin-bottom: 1rem;
}

.alert-light ul {
    color: var(--neutral--100);
    margin-bottom: 1rem;
}

.alert-light ul li {
    margin-bottom: 0.5rem;
}

/* Example cards */
.example-card {
    background-color: var(--neutral--700);
    border: 1px solid var(--neutral--600);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.example-card:hover {
    border-color: var(--neutral--500);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.example-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.example-header i {
    font-size: 1.2rem;
    margin-right: 8px;
}

.example-header h6 {
    margin: 0;
    color: var(--neutral--100);
    font-weight: 600;
}

.example-preview {
    position: relative;
    max-height: 120px;
    overflow: hidden;
}

.example-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, var(--neutral--700));
    pointer-events: none;
}

.example-preview code {
    font-size: 11px;
    line-height: 1.3;
    color: var(--neutral--300);
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
}

.example-card:hover .example-preview {
    opacity: 0.85;
}

/* SEO content sections */
.content-sections .content-block {
    max-width: 960px;
    margin: 0 auto;
    color: var(--neutral--100);
}

.content-sections .content-block h2,
.content-sections .content-block h3,
.content-sections h2,
.content-sections h3 {
    color: var(--neutral--50);
    font-weight: 600;
}

.content-sections .content-block p,
.content-sections p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--neutral--200);
}

.content-sections .content-block ul,
.content-sections .content-block ol,
.content-sections ul,
.content-sections ol {
    margin-left: 1.25rem;
    line-height: 1.7;
    color: var(--neutral--200);
}

.content-sections .content-block ul li,
.content-sections .content-block ol li,
.content-sections li {
    margin-bottom: 0.5rem;
}

.content-sections code {
    color: var(--neutral--200);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.content-sections .terminal-window code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* Before/after code cards */
.before-after-cards .code-card {
    background-color: var(--neutral--800);
    border: 1px solid var(--neutral--600);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.25);
}

.code-card-header {
    background: rgba(13, 110, 253, 0.1);
    border-bottom: 1px solid var(--neutral--600);
    color: var(--neutral--50);
    font-weight: 600;
    padding: 12px 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-card pre {
    margin: 0;
    padding: 18px 20px;
    background: transparent;
    color: var(--neutral--200);
    font-size: 13px;
    line-height: 1.6;
}

.code-card code {
    color: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

/* FAQ */
.faq-container {
    max-width: 100%;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a2a;
}

.faq-question {
    padding: 1rem;
    background: #3a3a3a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #4a4a4a;
}

.faq-question.active {
    background-color: #0000;
    background-image: linear-gradient(to right, var(--accent--primary-1), var(--secondary--color-1));
    color: white;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: #fff;
}

.faq-question.active .faq-icon {
    color: white;
}

.faq-answer {
    display: none;
    padding: 1rem;
    background: #2a2a2a;
    border-top: 1px solid #e0e0e0;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    background-color: #0000;
    background-image: linear-gradient(to right, var(--accent--primary-1), var(--secondary--color-1));
    border: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    cursor: pointer;
}

.share-btn:hover {
    opacity: 0.6;
    color: white;
    transform: scale(1.1);
}

.share-btn i {
    font-size: 1.2rem;
}

/* Related tools */
.content-tools-section {
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.tool-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.1), transparent);
    transition: left 0.5s;
}

.tool-item:hover::before {
    left: 100%;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.tool-item:hover .tool-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.tool-content {
    flex: 1;
}

.tool-content h4 {
    color: #fff;
    margin: 0 0 8px 0;
    transition: color 0.3s ease;
}

.tool-item:hover .tool-content h4 {
    color: #007bff;
}

.tool-content p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.tool-item:hover .tool-content p {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .example-card {
        margin-bottom: 15px;
        transition: none;
    }

    .example-card:hover {
        transform: none;
        box-shadow: none;
    }

    .example-preview {
        max-height: 80px;
    }

    .example-preview code {
        font-size: 10px;
    }

    .share-buttons {
        justify-content: flex-start;
    }

    .faq-question h3 {
        font-size: 1rem;
    }

    .tool-item {
        display: grid;
    }
}

/* Terminal Window Style (macOS) */
.terminal-window {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #3e3e3e;
}

.terminal-header {
    background-color: #2d2d2d;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #3e3e3e;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-btn-close {
    background-color: #ff5f56;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}

.terminal-btn-minimize {
    background-color: #ffbd2e;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}

.terminal-btn-maximize {
    background-color: #27c93f;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}

.terminal-title {
    color: #cccccc;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    flex: 1;
    text-align: center;
    user-select: none;
}

.terminal-copy-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-copy-btn:hover {
    background-color: #3e3e3e;
    color: #ffffff;
}

.terminal-copy-btn.copied {
    color: #27c93f;
}

.terminal-copy-btn.copied i::before {
    content: "\f00c"; /* fa-check */
}

.terminal-copy-btn i {
    transition: transform 0.2s ease;
}

.terminal-copy-btn:hover i {
    transform: scale(1.1);
}

.terminal-body {
    background-color: #1e1e1e;
    padding: 16px;
    overflow: auto;
    max-height: 480px;
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a #1e1e1e;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

.terminal-body::-webkit-scrollbar-corner {
    background: #1e1e1e;
}

.terminal-body pre {
    margin: 0;
    padding: 0;
    background: transparent;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow: visible;
}

.terminal-body code {
    color: #d4d4d4;
    white-space: pre;
    word-break: normal;
    font-family: inherit;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Syntax highlighting básico para terminal */
.terminal-body .language-php,
.terminal-body .language-javascript,
.terminal-body .language-python {
    color: #d4d4d4;
}

/* PHP syntax colors */
.terminal-body .language-php .keyword,
.terminal-body .language-php .function {
    color: #569cd6;
}

.terminal-body .language-php .string {
    color: #ce9178;
}

.terminal-body .language-php .comment {
    color: #6a9955;
}

/* JavaScript syntax colors */
.terminal-body .language-javascript .keyword,
.terminal-body .language-javascript .function {
    color: #569cd6;
}

.terminal-body .language-javascript .string {
    color: #ce9178;
}

.terminal-body .language-javascript .comment {
    color: #6a9955;
}

/* Python syntax colors */
.terminal-body .language-python .keyword,
.terminal-body .language-python .function {
    color: #569cd6;
}

.terminal-body .language-python .string {
    color: #ce9178;
}

.terminal-body .language-python .comment {
    color: #6a9955;
}

@media (max-width: 768px) {
    .terminal-window {
        margin-bottom: 1.5rem;
    }

    .terminal-body {
        padding: 12px;
    }

    .terminal-body pre {
        font-size: 11px;
    }

    .terminal-title {
        font-size: 11px;
    }
}

/* Tool Window — macOS style for I/O panels */
.tool-window {
    background-color: #1e1e1e;
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tool-window-header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #3e3e3e;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
}

.tool-window-title {
    color: #cccccc;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    flex: 1;
    text-align: center;
    user-select: none;
}

.tool-window-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tool-window-actions .btn {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    border-color: #555;
    color: #ccc;
    background: transparent;
}

.tool-window-actions .btn:hover {
    background: #3e3e3e;
    border-color: #666;
    color: #fff;
}

.tool-window-actions .btn-primary {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

.tool-window-actions .btn-primary:hover {
    background: #0052a3;
    border-color: #0052a3;
    color: #fff;
}

.tool-window-actions .btn-outline-secondary,
.tool-window-actions .btn-outline-danger {
    border-color: #555;
    color: #ccc;
}

.tool-window-actions .btn-outline-secondary:hover {
    background: #3e3e3e;
    border-color: #666;
    color: #fff;
}

.tool-window-actions .btn-outline-danger {
    border-color: #8b4049;
    color: #f48771;
}

.tool-window-actions .btn-outline-danger:hover {
    background: rgba(244, 135, 113, 0.15);
    border-color: #f48771;
    color: #f48771;
}

.tool-window-body {
    padding: 16px;
    background: #1e1e1e;
    overflow: auto;
    max-height: 600px;
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a #1e1e1e;
}

.tool-window-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tool-window-body::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 3px;
}

.tool-window-body::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.tool-window-body::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

.tool-window-body::-webkit-scrollbar-corner {
    background: #1e1e1e;
}

.tool-window .text-area,
.tool-window textarea,
.tool-window input[type="text"],
.tool-window input[type="number"],
.tool-window input[type="url"],
.tool-window input[type="email"],
.tool-window input[type="password"],
.tool-window .form-control,
.tool-window .form-select,
.tool-window .minifier-editor,
.tool-window .base64-textarea {
    background: #252526;
    border-color: #3e3e3e;
    color: #d4d4d4;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.tool-window .text-area:focus,
.tool-window textarea:focus,
.tool-window input:focus,
.tool-window .form-control:focus,
.tool-window .form-select:focus {
    background: #2d2d2d;
    border-color: #569cd6;
    color: #d4d4d4;
    box-shadow: 0 0 0 0.2rem rgba(86, 156, 214, 0.25);
    outline: none;
}

.tool-window .text-area::placeholder,
.tool-window textarea::placeholder,
.tool-window input::placeholder {
    color: #6a6a6a;
}

.tool-window .form-label,
.tool-window label {
    color: #cccccc;
}

.tool-window .text-muted {
    color: #888888 !important;
}

.tool-window pre,
.tool-window .json-formatted,
.tool-window .minifier-editor[readonly],
.tool-window #output,
.tool-window #hashResult,
.tool-window #unitResult,
.tool-window #timestampResult {
    background: transparent;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    border: none;
    padding: 0;
    margin: 0;
}

.tool-window .file-upload-area {
    border-radius: 6px;
}

.tool-window .file-upload-area.drag-over {
    border-color: #569cd6;
    background-color: rgba(86, 156, 214, 0.08);
}

@media (max-width: 768px) {
    .tool-window-header {
        padding: 6px 10px;
        flex-wrap: wrap;
    }

    .tool-window-body {
        padding: 12px;
        max-height: 400px;
    }

    .tool-window-title {
        font-size: 11px;
    }

    .tool-window-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Toast notifications */
.helppdev-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #2d2d2d;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.helppdev-toast--visible {
    opacity: 1;
}

.helppdev-toast--success {
    border-left: 4px solid #4ade80;
}

.helppdev-toast--error {
    border-left: 4px solid #f87171;
}

.helppdev-toast--info {
    border-left: 4px solid #60a5fa;
}
