/* ==========================================================================
   TOOLS.PHP STYLES
   ========================================================================== */

@import url('/styles/shared.css');

/* Form */
.search-form-container {
    padding: 2rem;
}

.tools-form .form-row-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    width: 100%;
}

.search-input,
.server-select,
.command-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.search-input:focus,
.server-select:focus,
.command-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.server-health-info {
    margin-top: 0.75rem;
}

.health-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.health-good {
    background: #ecfdf5;
    color: #059669;
}

.health-bad {
    background: #fef2f2;
    color: #dc2626;
}

.input-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.button-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-btn,
.secondary-btn,
.tools-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.search-btn:hover,
.tools-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.secondary-btn {
    background: #6b7280;
}

.secondary-btn:hover {
    background: #4b5563;
}

.secondary-btn:disabled,
.tools-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.turnstile-container-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rate-limit-info {
    margin-top: 1rem;
    text-align: center;
    color: #6b7280;
}

/* Error message - override for tools */
.error-message h2 {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #dc2626;
}

/* Success message */
.tools-success {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.success-content h3 {
    margin: 0 0 0.5rem 0;
    color: #15803d;
}

.success-content p {
    margin: 0;
    color: #15803d;
}

.success-content small {
    color: #16a34a;
}

/* Result header */
.result-header-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.result-actions-mobile {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.server-badge {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-all-btn {
    background: #059669 !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-all-btn:hover {
    background: #047857 !important;
    transform: translateY(-1px);
}

/* Results */
.results-container {
    padding: 2rem;
}

.tools-data-container {
    background: #1f2937;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.tools-data {
    color: #10b981;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
    min-width: 0;
}

/* Live progress */

.live-progress-container {
    display: none;
    margin-bottom: 10px;
}

.live-progress-container.show {
    display: block;
}

.live-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-progress-bar-bg {
    flex: 1;
    background: #e5e7eb;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
}

.live-progress-bar {
    width: 0%;
    height: 100%;
    background: #3b82f6;
    transition: width 0.2s ease;
}

.live-progress-container.indeterminate .live-progress-bar {
    width: 40%;
    min-width: 120px;
    background: linear-gradient(90deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.6) 50%, rgba(59,130,246,0.15) 100%);
    animation: live-progress-indeterminate 1.5s linear infinite;
    transform: translateX(-100%);
}

.live-progress-container.indeterminate .live-progress-text {
    color: #1f2937;
}

@keyframes live-progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

.live-progress-text {
    min-width: 48px;
    font-size: 12px;
    color: #374151;
}

/* Placeholder */
.placeholder-message {
    text-align: center;
    color: #6b7280;
    padding: 1.75rem 1rem 2.25rem;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.placeholder-content h4 {
    color: #374151;
    margin-bottom: 1rem;
}


/* Responsive */
@media (min-width: 768px) {
    .tools-form .form-row-mobile {
        flex-direction: row;
    }

    .form-group {
        flex: 1;
    }

    .button-group-mobile {
        flex-direction: row;
        justify-content: flex-start;
    }

    .button-group-mobile .tools-action-btn {
        min-width: 160px;
    }

    .result-header-mobile {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .search-form-container {
        padding: 1.5rem;
    }

    .ip-header-modern {
        padding: 1rem 1.25rem;
        font-size: 1.25rem;
    }

    .tools-success {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .tools-data {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .result-actions-mobile {
        justify-content: space-between;
    }

}

@media (max-width: 480px) {

    .tools-action-btn {
        min-height: 42px !important;
        font-size: 0.9rem !important;
    }

    .server-badge,
    .copy-all-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}
